public class RepeatingCharIterator extends DelegatingUnaryCharIterator
CharIterator
that cycles the values of an CharIterable
forever. This class repeatedly calls
CharIterable.iterator()
to receive new values when the iterator ends, so it's possible to cause this
CharIterator
to terminate by providing an empty CharIterator
. If the CharIterable
never
returns an empty CharIterator
, this CharIterator
will never terminate.iterator
EMPTY
Constructor and Description |
---|
RepeatingCharIterator(CharIterable iterable,
int times) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
char |
nextChar()
Return the next
char in this iterator. |
remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public RepeatingCharIterator(CharIterable iterable, int times)
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Character>
hasNext
in class DelegatingTransformingIterator<java.lang.Character,CharIterator,java.lang.Character>
public char nextChar()
CharIterator
char
in this iterator.