package kotlin.ranges; import kotlin.collections.IntIterator; import kotlin.internal.ProgressionUtilKt; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.markers.KMappedMarker; /* loaded from: classes5.dex */ public class IntProgression implements Iterable, KMappedMarker { public static final Companion Companion = new Companion(null); public final int first; public final int last; public final int step; public final int getFirst() { return this.first; } public final int getLast() { return this.last; } public final int getStep() { return this.step; } public boolean isEmpty() { if (this.step > 0) { if (this.first <= this.last) { return false; } } else if (this.first >= this.last) { return false; } return true; } public IntProgression(int i, int i2, int i3) { if (i3 == 0) { throw new IllegalArgumentException("Step must be non-zero."); } if (i3 == Integer.MIN_VALUE) { throw new IllegalArgumentException("Step must be greater than Int.MIN_VALUE to avoid overflow on negation."); } this.first = i; this.last = ProgressionUtilKt.getProgressionLastElement(i, i2, i3); this.step = i3; } @Override // java.lang.Iterable public IntIterator iterator() { return new IntProgressionIterator(this.first, this.last, this.step); } public boolean equals(Object obj) { if (obj instanceof IntProgression) { if (!isEmpty() || !((IntProgression) obj).isEmpty()) { IntProgression intProgression = (IntProgression) obj; if (this.first != intProgression.first || this.last != intProgression.last || this.step != intProgression.step) { } } return true; } return false; } public int hashCode() { if (isEmpty()) { return -1; } return (((this.first * 31) + this.last) * 31) + this.step; } public String toString() { StringBuilder sb; int i; if (this.step > 0) { sb = new StringBuilder(); sb.append(this.first); sb.append(".."); sb.append(this.last); sb.append(" step "); i = this.step; } else { sb = new StringBuilder(); sb.append(this.first); sb.append(" downTo "); sb.append(this.last); sb.append(" step "); i = -this.step; } sb.append(i); return sb.toString(); } public static final class Companion { public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } public Companion() { } public final IntProgression fromClosedRange(int i, int i2, int i3) { return new IntProgression(i, i2, i3); } } }