com.rolemodelsoft.drawlet
Interface FigureEnumeration

All Known Implementing Classes:
FigureVectorEnumerator

public interface FigureEnumeration

An object that implements the FigureEnumeration interface generates a series of Figures, one at a time. Successive calls to the nextFigure method return successive Figures of the series. This is just like a standard Enumeration, except we know we are dealing with Figures and therefore users don't have to do any casting.

For example, to print all Figures of a vector v:

     for (FigureEnumeration e = MyFigureEnumerator(v); e.hasMoreElements() ;) {
         System.out.println(e.nextElement());
}

Since:
JDK1.1
See Also:
Enumeration

Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more figures.
 Figure nextElement()
          Returns the next Figure of this enumeration.
 

Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more figures.
Returns:
boolean value of true if this enumeration contains more figures; false otherwise.
Since:
JDK1.1

nextElement

public Figure nextElement()
Returns the next Figure of this enumeration.
Returns:
the Figure which is the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.
Since:
JDK1.1