JHotDraw 6.0b1

org.jhotdraw.framework
Interface HandleEnumeration

All Known Implementing Classes:
HandleAndEnumerator, HandleEnumerator

public interface HandleEnumeration

Interface for Enumerations that access Handles. It provides a method nextHandle, that hides the down casting from client code.


Method Summary
 boolean hasNextHandle()
           
 Handle nextHandle()
          Returns the next element of the enumeration.
 void reset()
          Reset the enumeration so it can be reused again.
 java.util.List toList()
          Returns a list with all elements currently available in the enumeration.
 

Method Detail

nextHandle

Handle nextHandle()
Returns the next element of the enumeration. Calls to this method will enumerate successive elements.

Throws:
java.util.NoSuchElementException - If no more elements exist.

hasNextHandle

boolean hasNextHandle()

toList

java.util.List toList()
Returns a list with all elements currently available in the enumeration. That means, elements retrieved already by calling nextHandle() are not contained. This method does not change the position of the enumeration. Warning: this method is not necessarily synchronized so this enumeration should not be modified at the same time!

Returns:
list with all elements currently available in the enumeration.

reset

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.


JHotDraw 6.0b1