cz.cuni.amis.utils.iterators
Class CircularIterator<E>

Package class diagram package CircularIterator
java.lang.Object
  extended by cz.cuni.amis.utils.iterators.CircularIterator<E>
Type Parameters:
E - contents of the iterable
All Implemented Interfaces:
Iterator<E>
Direct Known Subclasses:
ShiftedCircularIterator

public class CircularIterator<E>
extends Object
implements Iterator<E>

Implements a circular iterator that iterates over any reasonable iterable instance. Not fully tested!

Author:
Radek 'Black_Hand' Pibil

Field Summary
protected  boolean passedEnd
           
 
Constructor Summary
CircularIterator(Iterable<E> toIterateOver)
           
 
Method Summary
protected  Iterable<E> getIterable()
           
protected  Iterator<E> getIterator()
           
 boolean hasNext()
           
 boolean hasPassedEnd()
           
 E next()
           
 void remove()
           
protected  void restartIterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

passedEnd

protected boolean passedEnd
Constructor Detail

CircularIterator

public CircularIterator(Iterable<E> toIterateOver)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

next

public E next()
Specified by:
next in interface Iterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>

hasPassedEnd

public boolean hasPassedEnd()

getIterable

protected Iterable<E> getIterable()

getIterator

protected Iterator<E> getIterator()

restartIterator

protected void restartIterator()


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.