laser.util
Class EmptyEnumeration

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

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

The EmptyEnumeration class implements an Enumeration which contains no elements. This means that hasMoreElements will always return false and nextElement will always throw NoSuchElementException.

Author:
Heather M. Conboy (laser-software@cs.umass.edu)

Constructor Summary
EmptyEnumeration()
          Creates a new EmptyEnumeration.
 
Method Summary
 boolean hasMoreElements()
          Returns whether or not there are more elements within this Enumeration.
 java.lang.Object nextElement()
          Returns the next element in this Enumeration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyEnumeration

public EmptyEnumeration()
Creates a new EmptyEnumeration.

Method Detail

hasMoreElements

public boolean hasMoreElements()
Returns whether or not there are more elements within this Enumeration.

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

nextElement

public java.lang.Object nextElement()
Returns the next element in this Enumeration.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next element if it exists
Throws:
java.util.NoSuchElementException - always since there are no elements in this Enumeration