laser.util
Class LeftToRightEnumeration

java.lang.Object
  extended by laser.util.LeftToRightEnumeration
All Implemented Interfaces:
java.util.Enumeration

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

The LeftToRightEnumeration class guarentees that the elements within the given Array or Vector are returned in left to right order (ie. starting at index zero and ending at the number of elements minus one).


Constructor Summary
LeftToRightEnumeration(java.lang.Object[] a)
          Creates a new LeftToRightEnumeration for the given Array.
LeftToRightEnumeration(java.util.Vector v)
          Creates a new LeftToRightEnumeration for the given Vector.
 
Method Summary
 boolean hasMoreElements()
          Returns whether or not there are more elements left to be returned.
 java.lang.Object nextElement()
          Returns the next element within the Vector if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeftToRightEnumeration

public LeftToRightEnumeration(java.lang.Object[] a)
Creates a new LeftToRightEnumeration for the given Array.

Parameters:
a - The Array of interest

LeftToRightEnumeration

public LeftToRightEnumeration(java.util.Vector v)
Creates a new LeftToRightEnumeration for the given Vector.

Parameters:
v - The Vector of interest
Method Detail

hasMoreElements

public boolean hasMoreElements()
Returns whether or not there are more elements left to be returned.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
True if there are more elements and false otherwise

nextElement

public java.lang.Object nextElement()
                             throws java.util.NoSuchElementException
Returns the next element within the Vector if it exists.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next element
Throws:
java.util.NoSuchElementException - if there are no more elements to be returned