harpoon.Util
Class ReverseIterator
java.lang.Object
|
+--harpoon.Util.UnmodifiableIterator
|
+--harpoon.Util.ReverseIterator
- All Implemented Interfaces:
- Iterator
- public class ReverseIterator
- extends UnmodifiableIterator
- implements Iterator
A ReverseIterator
iterates through an Iterator
in reverse order.
- Version:
- $Id: ReverseIterator.java,v 1.2 2002/02/25 21:08:52 cananian Exp $
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
Method Summary |
boolean |
hasNext()
Returns true if the iteration has more elements. |
Object |
next()
Returns the next element in the iteration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReverseIterator
public ReverseIterator(Iterator it)
- Creates a
ReverseIterator
of Iterator
it
.
hasNext
public boolean hasNext()
- Description copied from class:
UnmodifiableIterator
- Returns
true
if the iteration has more elements.
- Specified by:
hasNext
in interface Iterator
- Specified by:
hasNext
in class UnmodifiableIterator
- Returns:
true
if the iterator has more elements.
next
public Object next()
- Description copied from class:
UnmodifiableIterator
- Returns the next element in the iteration.
- Specified by:
next
in interface Iterator
- Specified by:
next
in class UnmodifiableIterator