what-the-bank/sources/com/google/android/gms/common/data/DataBufferIterator.java

41 lines
1.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.common.data;
import com.google.android.gms.common.internal.Preconditions;
import java.util.Iterator;
import java.util.NoSuchElementException;
/* loaded from: classes.dex */
public class DataBufferIterator<T> implements Iterator<T> {
protected final DataBuffer<T> zaa;
protected int zab = -1;
public DataBufferIterator(DataBuffer<T> dataBuffer) {
this.zaa = (DataBuffer) Preconditions.checkNotNull(dataBuffer);
}
@Override // java.util.Iterator
public final boolean hasNext() {
return this.zab < this.zaa.getCount() - 1;
}
@Override // java.util.Iterator
public T next() {
if (!hasNext()) {
int i = this.zab;
StringBuilder sb = new StringBuilder(46);
sb.append("Cannot advance the iterator beyond ");
sb.append(i);
throw new NoSuchElementException(sb.toString());
}
DataBuffer<T> dataBuffer = this.zaa;
int i2 = this.zab + 1;
this.zab = i2;
return dataBuffer.get(i2);
}
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException("Cannot remove elements from a DataBufferIterator");
}
}