public class ReverseListIterator<E>
extends java.lang.Object
implements java.util.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.| Constructor and Description |
|---|
ReverseListIterator(java.util.List<E> l)
Creates a
ReverseListIterator. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E o) |
boolean |
hasNext() |
boolean |
hasPrevious() |
E |
next() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
remove() |
void |
set(E o) |
public ReverseListIterator(java.util.List<E> l)
ReverseListIterator.public boolean hasNext()
public boolean hasPrevious()
hasPrevious in interface java.util.ListIterator<E>public E next()
public int nextIndex()
nextIndex in interface java.util.ListIterator<E>public int previousIndex()
previousIndex in interface java.util.ListIterator<E>public void remove()
Copyright (c) 2006 C. Scott Ananian