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