package j.r0;

import j.k0.f0;
import java.util.NoSuchElementException;

/* JADX INFO: compiled from: ProgressionIterators.kt */
/* JADX INFO: loaded from: classes.dex */
public final class j extends f0 {
    private final long b;
    private final long d;
    private boolean e;
    private long f;

    public j(long j2, long j3, long j4) {
        this.b = j4;
        this.d = j3;
        boolean z = true;
        if (j4 <= 0 ? j2 < j3 : j2 > j3) {
            z = false;
        }
        this.e = z;
        this.f = z ? j2 : this.d;
    }

    @Override // j.k0.f0
    public long b() {
        long j2 = this.f;
        if (j2 != this.d) {
            this.f = this.b + j2;
        } else {
            if (!this.e) {
                throw new NoSuchElementException();
            }
            this.e = false;
        }
        return j2;
    }

    @Override // java.util.Iterator
    public boolean hasNext() {
        return this.e;
    }
}
