jdsl.core.ref
Class ArrayEnumerator

java.lang.Object
  |
  +--jdsl.core.ref.ArrayEnumerator

public class ArrayEnumerator
extends java.lang.Object
implements java.util.Enumeration

An array based enumerator to implement enumerations efficiently for jdsl structures.

Author:
Mike Boilen (mgb)

Constructor Summary
ArrayEnumerator(java.lang.Object[] array)
          Class constructor.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 java.lang.Object nextElement()
          Returns the next element of this enumeration.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayEnumerator

public ArrayEnumerator(java.lang.Object[] array)
Class constructor. Uses the array to store the elements that this Enumeraition traverses. The array is NOT copied.
Parameters:
array - The elements that this enumeration should traverse.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.
Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if this enumeration contains more elements; false otherwise.

nextElement

public java.lang.Object nextElement()
Returns the next element of this enumeration.
Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.