|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.iterators.CircularListIterator<E>
E
- contents of the iterablepublic class CircularListIterator<E>
Implements a circular iterator that iterates over any List instance instance.
Useful for obtaining bidirectional ListIterator
Field Summary
protected boolean
moved
protected boolean
passedBeginning
protected boolean
passedEnd
Constructor Summary
CircularListIterator(CircularListIterator<E> source)
Copy constructor for CircularListIterator.
CircularListIterator(java.util.List<E> toIterateOver)
Constructs an instance of an CircularListIterator.
CircularListIterator(java.util.List<E> toIterateOver,
int index)
Constructs an instance of an CircularListIterator.
Method Summary
void
add(E e)
int
currentIndex()
protected java.lang.Iterable<E>
getIterable()
protected java.util.Iterator<E>
getIterator()
boolean
hasNext()
boolean
hasPassedBeginning()
boolean
hasPassedEnd()
boolean
hasPrevious()
E
next()
int
nextIndex()
CircularListIterator<E>
nextIter()
E
previous()
int
previousIndex()
CircularListIterator<E>
previousIter()
void
remove()
protected void
restartIteratorBeginning()
protected void
restartIteratorEnd()
void
set(E e)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
passedEnd
protected boolean passedEnd
passedBeginning
protected boolean passedBeginning
moved
protected boolean moved
Constructor Detail
CircularListIterator
public CircularListIterator(java.util.List<E> toIterateOver)
toIterateOver
- List to be iterated over
CircularListIterator
public CircularListIterator(java.util.List<E> toIterateOver,
int index)
toIterateOver
- List to be iterated overindex
- an index to begin iteration at
CircularListIterator
public CircularListIterator(CircularListIterator<E> source)
source
-
Method Detail
hasNext
public boolean hasNext()
next
public E next()
remove
public void remove()
hasPassedEnd
public boolean hasPassedEnd()
hasPassedBeginning
public boolean hasPassedBeginning()
getIterable
protected java.lang.Iterable<E> getIterable()
getIterator
protected java.util.Iterator<E> getIterator()
restartIteratorBeginning
protected void restartIteratorBeginning()
restartIteratorEnd
protected void restartIteratorEnd()
add
public void add(E e)
add
in interface java.util.ListIterator<E>
hasPrevious
public boolean hasPrevious()
hasPrevious
in interface java.util.ListIterator<E>
nextIndex
public int nextIndex()
nextIndex
in interface java.util.ListIterator<E>
previous
public E previous()
previous
in interface java.util.ListIterator<E>
previousIndex
public int previousIndex()
previousIndex
in interface java.util.ListIterator<E>
set
public void set(E e)
set
in interface java.util.ListIterator<E>
currentIndex
public int currentIndex()
previousIter
public CircularListIterator<E> previousIter()
nextIter
public CircularListIterator<E> nextIter()
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD