public class RepeatingIntIterator extends DelegatingUnaryIntIterator
IntIterator
that cycles the values of an IntIterable
forever. This class repeatedly calls
IntIterable.iterator()
to receive new values when the iterator ends, so it's possible to cause this
IntIterator
to terminate by providing an empty IntIterator
. If the IntIterable
never
returns an empty IntIterator
, this IntIterator
will never terminate.iterator
EMPTY
Constructor and Description |
---|
RepeatingIntIterator(IntIterable iterable,
int times) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
int |
nextInt() |
remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, count, from, from, from, from, from, from, from, from, from, from, from, isEmpty, of, reduce, removeAll, skip, skip
public RepeatingIntIterator(IntIterable iterable, int times)
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Integer>
hasNext
in class DelegatingTransformingIterator<java.lang.Integer,IntIterator,java.lang.Integer>
public int nextInt()