package o; import java.util.Iterator; import java.util.NoSuchElementException; /* loaded from: classes.dex */ public abstract class ApF implements Iterator { public boolean a; public T b; public boolean e; protected abstract void b(); @Override // java.util.Iterator public boolean hasNext() { if (!this.e) { b(); this.e = true; } return this.a; } @Override // java.util.Iterator public T next() { if (!this.e) { hasNext(); } if (!this.a) { throw new NoSuchElementException(); } T t = this.b; b(); if (!this.a) { this.b = null; } return t; } @Override // java.util.Iterator public void remove() { throw new UnsupportedOperationException("remove not supported"); } }