/* ITI 1121/1521. Introduction to Computer Science II * Assignment/Devoir 3 * * */ public interface Iterator { /** * Returns true if the iteration has more elements. (In other * words, returns true if next would return an element rather than * throwing an exception.) * * @return true if the iterator has more elements. */ public abstract boolean hasNext(); /** * Returns the next element in the interation. * * @return the next element in the iteration. * @exception NoSuchElementException iteration has no more elements. */ public abstract E next(); /** * Removes from the list the last element that was returned by * next. This call can only be made once per call to next. * * @exception IllegalStateException if next has not been called, or * the number of element removes exceeds the number of time * next was called. */ public void remove(); }