package DataStructures; import java.util.Iterator; import java.util.NoSuchElementException; /** * Provides the enumeration of an empty collection * @author Peter Williams */ class EmptyIterator implements Iterator { /** * @return false in all cases */ public boolean hasNext() { return false; } /** * @exception NoSuchElementException in all cases */ public E next() { throw new NoSuchElementException(); } /** * @exception IllegalStateException in all cases */ public void remove() { throw new IllegalStateException(); } }