Package net.cscott.jutil
Class ReverseListIterator<E>
java.lang.Object
net.cscott.jutil.ReverseListIterator<E>
- All Implemented Interfaces:
Iterator<E>,ListIterator<E>
ReverseListIterator takes a List and gives
you an Iterator that traverses the list in reverse
order. Similar to using ReverseIterator(l.iterator())
but more efficient as it does not need to create a snapshot.- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
-
Constructor Details
-
ReverseListIterator
Creates aReverseListIterator.
-
-
Method Details
-
add
- Specified by:
addin interfaceListIterator<E>
-
hasNext
public boolean hasNext() -
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceListIterator<E>
-
next
-
nextIndex
public int nextIndex()- Specified by:
nextIndexin interfaceListIterator<E>
-
previous
- Specified by:
previousin interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndexin interfaceListIterator<E>
-
remove
public void remove() -
set
- Specified by:
setin interfaceListIterator<E>
-