jimu-decompiled/sources/com/google/common/collect/AbstractSequentialIterator.java
2025-05-13 19:24:51 +02:00

32 lines
692 B
Java

package com.google.common.collect;
import java.util.NoSuchElementException;
/* loaded from: classes.dex */
public abstract class AbstractSequentialIterator<T> extends UnmodifiableIterator<T> {
private T a;
protected AbstractSequentialIterator(T t) {
this.a = t;
}
protected abstract T a(T t);
@Override // java.util.Iterator
public final boolean hasNext() {
return this.a != null;
}
@Override // java.util.Iterator
public final T next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
try {
return this.a;
} finally {
this.a = a(this.a);
}
}
}