Rabbit-R1/android (non root)/java/sources/com/google/common/collect/ConsumingQueueIterator.java

26 lines
732 B
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.util.Queue;
import javax.annotation.CheckForNull;
@ElementTypesAreNonnullByDefault
/* loaded from: classes3.dex */
final class ConsumingQueueIterator<T> extends AbstractIterator<T> {
private final Queue<T> queue;
/* JADX INFO: Access modifiers changed from: package-private */
public ConsumingQueueIterator(Queue<T> queue) {
this.queue = (Queue) Preconditions.checkNotNull(queue);
}
@Override // com.google.common.collect.AbstractIterator
@CheckForNull
public T computeNext() {
if (this.queue.isEmpty()) {
return endOfData();
}
return this.queue.remove();
}
}