Package diva.util
Class ReverseIterator
- java.lang.Object
-
- diva.util.IteratorAdapter
-
- diva.util.ReverseIterator
-
- All Implemented Interfaces:
java.util.Iterator
public class ReverseIterator extends IteratorAdapter
A reverse-order iterator over a List.- Version:
- $Id$
- Author:
- John Reekie
-
-
Constructor Summary
Constructors Constructor Description ReverseIterator(java.util.List list)
Construct a reverse iterator on the given list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test if there are more elements.java.lang.Object
next()
Return the next element.-
Methods inherited from class diva.util.IteratorAdapter
remove
-
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Test if there are more elements.- Specified by:
hasNext
in interfacejava.util.Iterator
- Overrides:
hasNext
in classIteratorAdapter
- Returns:
- true if there more elements.
-
next
public java.lang.Object next() throws java.util.NoSuchElementException
Return the next element.- Specified by:
next
in interfacejava.util.Iterator
- Overrides:
next
in classIteratorAdapter
- Returns:
- the next element.
- Throws:
java.util.NoSuchElementException
- If the element does not exist.
-
-