public class RepeatingDoubleIterator extends UnaryDoubleIterator
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,
long 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, of, reduce, skip, skip
public RepeatingDoubleIterator(DoubleIterable iterable, long times)
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Double>
hasNext
in class DelegatingIterator<java.lang.Double,DoubleIterator,java.lang.Double>
public double nextDouble()