org.jhotdraw.standard
Class FigureEnumerator

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

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

An Enumeration for a Collection of Figures.

Version:
<$CURRENT_VERSION$>

Constructor Summary
FigureEnumerator(java.util.Collection c)
           
 
Method Summary
static FigureEnumeration getEmptyEnumeration()
           
 boolean hasNextFigure()
          Returns true if the enumeration contains more elements; false if its empty.
 Figure nextFigure()
          Returns the next element 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

FigureEnumerator

public FigureEnumerator(java.util.Collection c)
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 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.

getEmptyEnumeration

public static FigureEnumeration getEmptyEnumeration()

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