cz.cuni.amis.utils.iterators
Class CircularIterator<E>
java.lang.Object
cz.cuni.amis.utils.iterators.CircularIterator<E>
- Type Parameters:
E
- contents of the iterable
- All Implemented Interfaces:
- java.util.Iterator<E>
- Direct Known Subclasses:
- ShiftedCircularIterator
public class CircularIterator<E>
- extends java.lang.Object
- implements java.util.Iterator<E>
Implements a circular iterator that iterates over any reasonable iterable instance.
Not fully tested!
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
passedEnd
protected boolean passedEnd
CircularIterator
public CircularIterator(java.lang.Iterable<E> toIterateOver)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator<E>
next
public E next()
- Specified by:
next
in interface java.util.Iterator<E>
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator<E>
hasPassedEnd
public boolean hasPassedEnd()
getIterable
protected java.lang.Iterable<E> getIterable()
getIterator
protected java.util.Iterator<E> getIterator()
restartIterator
protected void restartIterator()