what-the-bank/sources/com/google/common/collect/TransformedIterator.java

33 lines
941 B
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.util.Iterator;
/* loaded from: classes2.dex */
abstract class TransformedIterator<F, T> implements Iterator<T> {
final Iterator<? extends F> backingIterator;
/* JADX INFO: Access modifiers changed from: package-private */
public abstract T transform(F f);
/* JADX INFO: Access modifiers changed from: package-private */
public TransformedIterator(Iterator<? extends F> it) {
this.backingIterator = (Iterator) Preconditions.checkNotNull(it);
}
@Override // java.util.Iterator
public final boolean hasNext() {
return this.backingIterator.hasNext();
}
@Override // java.util.Iterator
public final T next() {
return transform(this.backingIterator.next());
}
@Override // java.util.Iterator
public final void remove() {
this.backingIterator.remove();
}
}