Interface ListIterator<E>


public interface ListIterator<E>


Method Summary
 boolean hasNext()
          Returns true if the iterator has a next element.
 boolean hasPrevious()
          Returns true if the iterator has a previous element.
 E next()
          Returns the next element and moves the iterator forward one position.
 E previous()
          Returns the previous element and moves the iterator backward one positoin.
 

Method Detail

hasNext

boolean hasNext()
Returns true if the iterator has a next element. This method does not change the state of the iterator.

Returns:
true if the iterator has a next element, otherwise false.

next

E next()
Returns the next element and moves the iterator forward one position.

Returns:
The next element. Calling this method on a new ListIterator until hasNext() returns false will return all element in the list from first to last.
Throws:
java.util.NoSuchElementException - if there is no next element.

hasPrevious

boolean hasPrevious()
Returns true if the iterator has a previous element. This method does not change the state of the iterator. Calling this method on a new ListIterator will return false.

Returns:
true if the iterator has a previous element, otherwise false.

previous

E previous()
Returns the previous element and moves the iterator backward one positoin.

Returns:
The previous element.
Throws:
java.util.NoSuchElementException - if there is no previous element.