net.cscott.jutil

Class ReverseListIterator<E>

public class ReverseListIterator<E> extends Object implements 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.

Version: $Id: ReverseListIterator.java,v 1.1 2003/03/20 01:58:20 cananian Exp $

Author: C. Scott Ananian

Constructor Summary
ReverseListIterator(List<E> l)
Creates a ReverseListIterator.
Method Summary
voidadd(E o)
booleanhasNext()
booleanhasPrevious()
Enext()
intnextIndex()
Eprevious()
intpreviousIndex()
voidremove()
voidset(E o)

Constructor Detail

ReverseListIterator

public ReverseListIterator(List<E> l)
Creates a ReverseListIterator.

Method Detail

add

public void add(E o)

hasNext

public boolean hasNext()

hasPrevious

public boolean hasPrevious()

next

public E next()

nextIndex

public int nextIndex()

previous

public E previous()

previousIndex

public int previousIndex()

remove

public void remove()

set

public void set(E o)
Copyright © 2003 C. Scott Ananian