public class RepeatingIterator<T> extends ReferenceIterator<T>
Iterator that cycles the values of an Iterable forever. This class repeatedly calls
Iterable.iterator() to receive new values when the iterator ends, so it's possible to cause this
Iterator to terminate by providing an empty Iterator. If the Iterable never returns an
empty Iterator, this Iterator will never terminate.iterator| Constructor and Description |
|---|
RepeatingIterator(java.lang.Iterable<? extends T> iterable,
int times) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
T |
next() |
removepublic RepeatingIterator(java.lang.Iterable<? extends T> iterable, int times)