package DataStructures; import java.util.Enumeration; import java.util.NoSuchElementException; /** * Provides the enumeration of an empty collection * @author Peter Williams */ class EmptyEnumeration implements Enumeration { /** * @return false in all cases */ public boolean hasMoreElements() { return false; } /** * @exception NoSuchElementException in all cases */ public E nextElement() { throw new NoSuchElementException(); } }