01: import java.util.NoSuchElementException;
02: 
03: /**
04:    A list iterator allows access of a position in a linked list.    This interface contains a subset of the methods of the 
05:    standard java.util.ListIterator interface. The methods for
06:    backward traversal are not included.
07: */
08: public interface ListIterator
09: {  
10:    /**
11:       Moves the iterator past the next element.
12:       @return the traversed element
13:    */
14:    Object next();
15:       
16:    /**
17:       Tests if there is an element after the iterator 
18:       position.
19:       @return true if there is an element after the iterator 
20:       position
21:    */
22:    boolean hasNext();
23:       
24:    /**
25:       Adds an element before the iterator position
26:       and moves the iterator past the inserted element.
27:       @param obj the object to add
28:    */
29:    void add(Object obj);
30:       
31:    /**
32:       Removes the last traversed element. This method may
33:       only be called after a call to the next() method.
34:    */
35:    void remove();
36: 
37:    /**
38:       Sets the last traversed element to a different 
39:       value. 
40:       @param obj the object to set
41:    */
42:    void set(Object obj);
43: }