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