package h.z;

import h.s.z;

/* JADX INFO: compiled from: Progressions.kt */
/* JADX INFO: loaded from: classes.dex */
public class f implements Iterable<Integer>, h.x.d.z.a {

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final a f1002g = new a(null);
    private final int b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final int f1003e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final int f1004f;

    /* JADX INFO: compiled from: Progressions.kt */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(h.x.d.h hVar) {
            this();
        }

        public final f a(int i2, int i3, int i4) {
            return new f(i2, i3, i4);
        }
    }

    public f(int i2, int i3, int i4) {
        if (i4 == 0) {
            throw new IllegalArgumentException("Step must be non-zero.");
        }
        if (i4 == Integer.MIN_VALUE) {
            throw new IllegalArgumentException("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");
        }
        this.b = i2;
        this.f1003e = h.v.c.c(i2, i3, i4);
        this.f1004f = i4;
    }

    public final int a() {
        return this.b;
    }

    public final int b() {
        return this.f1003e;
    }

    public final int c() {
        return this.f1004f;
    }

    @Override // java.lang.Iterable
    /* JADX INFO: renamed from: d, reason: merged with bridge method [inline-methods] */
    public z iterator() {
        return new g(this.b, this.f1003e, this.f1004f);
    }

    public boolean equals(Object obj) {
        if (obj instanceof f) {
            if (!isEmpty() || !((f) obj).isEmpty()) {
                f fVar = (f) obj;
                if (this.b != fVar.b || this.f1003e != fVar.f1003e || this.f1004f != fVar.f1004f) {
                }
            }
            return true;
        }
        return false;
    }

    public int hashCode() {
        if (isEmpty()) {
            return -1;
        }
        return (((this.b * 31) + this.f1003e) * 31) + this.f1004f;
    }

    public boolean isEmpty() {
        if (this.f1004f > 0) {
            if (this.b > this.f1003e) {
                return true;
            }
        } else if (this.b < this.f1003e) {
            return true;
        }
        return false;
    }

    public String toString() {
        StringBuilder sb;
        int i2;
        if (this.f1004f > 0) {
            sb = new StringBuilder();
            sb.append(this.b);
            sb.append("..");
            sb.append(this.f1003e);
            sb.append(" step ");
            i2 = this.f1004f;
        } else {
            sb = new StringBuilder();
            sb.append(this.b);
            sb.append(" downTo ");
            sb.append(this.f1003e);
            sb.append(" step ");
            i2 = -this.f1004f;
        }
        sb.append(i2);
        return sb.toString();
    }
}
