DAT
Interface Iterator


public interface Iterator

A class for sequentially accessing collections The Iterator should initially be pointing before the first element of the collection, so the first call to next() returns the first element.


Method Summary
 boolean hasNext()
          tests if there is a next item to return
 java.lang.Object next()
          Returns the next element a moves the iterator to the next position.
 

Method Detail

next

java.lang.Object next()
                      throws OutOfBounds
Returns the next element a moves the iterator to the next position.

Returns:
the next element in the collection
Throws:
OutOfBounds - if there is no next element

hasNext

boolean hasNext()
tests if there is a next item to return

Returns:
true if and only if there is a next item