org.openbp.common.util.iterator
Class EmptyEnumeration

java.lang.Object
  extended by org.openbp.common.util.iterator.EmptyEnumeration
All Implemented Interfaces:
java.util.Enumeration

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

Convenience class that can serve as an empty Enumeration. In order to use the class, retrieve an instance using the getInstance() method.

Author:
Heiko Erhardt

Method Summary
static EmptyEnumeration getInstance()
          Returns a global instance of this object.
 boolean hasMoreElements()
          Implementation of the Enumeration interface.
 java.lang.Object nextElement()
          Implementation of the Enumeration interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EmptyEnumeration getInstance()
Returns a global instance of this object. No problem, because this class does not contain any data.


hasMoreElements

public boolean hasMoreElements()
Implementation of the Enumeration interface.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
Always false

nextElement

public java.lang.Object nextElement()
Implementation of the Enumeration interface.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
Nothing, throws a NoSuchElementException instead


Copyright © 2011. All Rights Reserved.