com.claritysys.util
Class EmptyEnumeration

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

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

EmptyEnumeration provides a memory-efficient way for methods to return an Enumeration which has no elements. Since there are no instance variables used it is also multi-thread safe.

To acquire an instance, invoke instance.

Version:
$Revision: 2348 $
See Also:
Enumeration

Method Summary
 boolean hasMoreElements()
          Return false.
static java.util.Enumeration instance()
          Return the instance.
 java.lang.Object nextElement()
          Throw an exception if called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static java.util.Enumeration instance()
Return the instance.

Returns:
the single instance.

hasMoreElements

public boolean hasMoreElements()
Return false.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
false, no matter what.

nextElement

public java.lang.Object nextElement()
Throw an exception if called.

Specified by:
nextElement in interface java.util.Enumeration


Copyright ? 2002 Clarity Systems Group, LLC. All Rights Reserved.