what-the-bank/sources/o/C14994gdz.java

72 lines
1.9 KiB
Java

package o;
import java.util.Iterator;
/* renamed from: o.gdz, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C14994gdz<T> implements gdA<T> {
final gdE<T> b;
final int e;
/* JADX WARN: Multi-variable type inference failed */
public C14994gdz(gdE<? extends T> gde, int i) {
C14957gcv.e(gde, "");
this.b = gde;
this.e = i;
if (i >= 0) {
return;
}
StringBuilder sb = new StringBuilder("count must be non-negative, but was ");
sb.append(i);
sb.append('.');
throw new IllegalArgumentException(sb.toString().toString());
}
@Override // o.gdA
public final gdE<T> d(int i) {
int i2 = this.e + i;
return i2 < 0 ? new gdJ(this, i) : new gdH(this.b, this.e, i2);
}
/* renamed from: o.gdz$LWm */
/* loaded from: classes.dex */
public static final class LWm implements Iterator<T>, InterfaceC14932gcO {
private int b;
private final Iterator<T> d;
LWm(C14994gdz<T> c14994gdz) {
this.d = c14994gdz.b.e();
this.b = c14994gdz.e;
}
private final void a() {
while (this.b > 0 && this.d.hasNext()) {
this.d.next();
this.b--;
}
}
@Override // java.util.Iterator
public final T next() {
a();
return this.d.next();
}
@Override // java.util.Iterator
public final boolean hasNext() {
a();
return this.d.hasNext();
}
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
}
@Override // o.gdE
public final Iterator<T> e() {
return new LWm(this);
}
}