Files
rr3-apk/decompiled/sources/kotlin/collections/AbstractIterator.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

76 lines
2.0 KiB
Java

package kotlin.collections;
import java.util.Iterator;
import java.util.NoSuchElementException;
import kotlin.jvm.internal.markers.KMappedMarker;
/* loaded from: classes5.dex */
public abstract class AbstractIterator implements Iterator, KMappedMarker {
public Object nextValue;
public State state = State.NotReady;
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[State.values().length];
try {
iArr[State.Done.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[State.Ready.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
$EnumSwitchMapping$0 = iArr;
}
}
public abstract void computeNext();
@Override // java.util.Iterator
public void remove() {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
@Override // java.util.Iterator
public boolean hasNext() {
State state = this.state;
if (state == State.Failed) {
throw new IllegalArgumentException("Failed requirement.".toString());
}
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
if (i == 1) {
return false;
}
if (i != 2) {
return tryToComputeNext();
}
return true;
}
@Override // java.util.Iterator
public Object next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
this.state = State.NotReady;
return this.nextValue;
}
public final boolean tryToComputeNext() {
this.state = State.Failed;
computeNext();
return this.state == State.Ready;
}
public final void setNext(Object obj) {
this.nextValue = obj;
this.state = State.Ready;
}
public final void done() {
this.state = State.Done;
}
}