org.jhotdraw.standard
Class ReverseFigureEnumerator

java.lang.Object
  extended by org.jhotdraw.standard.ReverseFigureEnumerator
All Implemented Interfaces:
FigureEnumeration

public final class ReverseFigureEnumerator
extends java.lang.Object
implements FigureEnumeration

An Enumeration that enumerates a Collection of figures back (size-1) to front (0).

Version:
<$CURRENT_VERSION$>

Constructor Summary
ReverseFigureEnumerator(java.util.List l)
           
 
Method Summary
 boolean hasNextFigure()
          Returns true if the enumeration contains more elements; false if its empty.
 Figure nextFigure()
          Returns the next element casted as a figure of the enumeration.
 void reset()
          Reset the enumeration so it can be reused again.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReverseFigureEnumerator

public ReverseFigureEnumerator(java.util.List l)
Method Detail

hasNextFigure

public boolean hasNextFigure()
Returns true if the enumeration contains more elements; false if its empty.

Specified by:
hasNextFigure in interface FigureEnumeration

nextFigure

public Figure nextFigure()
Returns the next element casted as a figure of the enumeration. Calls to this method will enumerate successive elements.

Specified by:
nextFigure in interface FigureEnumeration
Throws:
java.util.NoSuchElementException - If no more elements exist.

reset

public void reset()
Reset the enumeration so it can be reused again. However, the underlying collection might have changed since the last usage so the elements and the order may vary when using an enumeration which has been reset.

Specified by:
reset in interface FigureEnumeration