66 lines
1.7 KiB
Java
66 lines
1.7 KiB
Java
package o;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.NoSuchElementException;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public final class gdJ<T> implements gdA<T> {
|
|
final gdE<T> b;
|
|
final int d;
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public gdJ(gdE<? extends T> gde, int i) {
|
|
C14957gcv.e(gde, "");
|
|
this.b = gde;
|
|
this.d = 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) {
|
|
return i >= this.d ? this : new gdJ(this.b, i);
|
|
}
|
|
|
|
/* loaded from: classes6.dex */
|
|
public static final class HBt implements Iterator<T>, InterfaceC14932gcO {
|
|
private final Iterator<T> a;
|
|
private int d;
|
|
|
|
HBt(gdJ<T> gdj) {
|
|
this.d = gdj.d;
|
|
this.a = gdj.b.e();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public final T next() {
|
|
int i = this.d;
|
|
if (i == 0) {
|
|
throw new NoSuchElementException();
|
|
}
|
|
this.d = i - 1;
|
|
return this.a.next();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public final boolean hasNext() {
|
|
return this.d > 0 && this.a.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 HBt(this);
|
|
}
|
|
}
|