package t8; import java.util.Iterator; import java.util.NoSuchElementException; /* loaded from: classes2.dex */ public abstract class b implements Iterator { /* renamed from: a, reason: collision with root package name */ private k0 f14420a = k0.NotReady; /* renamed from: b, reason: collision with root package name */ private Object f14421b; public /* synthetic */ class a { /* renamed from: a, reason: collision with root package name */ public static final /* synthetic */ int[] f14422a; static { int[] iArr = new int[k0.values().length]; iArr[k0.Done.ordinal()] = 1; iArr[k0.Ready.ordinal()] = 2; f14422a = iArr; } } private final boolean d() { this.f14420a = k0.Failed; a(); return this.f14420a == k0.Ready; } protected abstract void a(); protected final void b() { this.f14420a = k0.Done; } protected final void c(Object obj) { this.f14421b = obj; this.f14420a = k0.Ready; } @Override // java.util.Iterator public boolean hasNext() { k0 k0Var = this.f14420a; if (!(k0Var != k0.Failed)) { throw new IllegalArgumentException("Failed requirement.".toString()); } int i10 = a.f14422a[k0Var.ordinal()]; if (i10 == 1) { return false; } if (i10 != 2) { return d(); } return true; } @Override // java.util.Iterator public Object next() { if (!hasNext()) { throw new NoSuchElementException(); } this.f14420a = k0.NotReady; return this.f14421b; } @Override // java.util.Iterator public void remove() { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } }