Build 1.0_r1(from source)

java.util
Interface Iterator<E>

All Known Subinterfaces:
HeaderElementIterator, HeaderIterator, ListIterator<E>, TokenIterator
All Known Implementing Classes:
BasicHeaderElementIterator, BasicHeaderIterator, BasicListHeaderIterator, BasicTokenIterator, ConcurrentHashMap.EntryIterator, ConcurrentHashMap.KeyIterator, ConcurrentHashMap.ValueIterator, CursorJoiner, HashMap.HashMapIterator, IdentityHashMap.IdentityHashMapIterator, LinkedHashMap.LinkedHashIterator, Scanner, SynchronousQueue.EmptyIterator, TextUtils.SimpleStringSplitter, TreeMap.UnboundedKeyIterator, TreeMap.UnboundedValueIterator, WeakHashMap.HashIterator

public interface Iterator<E>

An Iterator is used to sequence over a collection of objects.


Method Summary
 boolean hasNext()
          Returns if there are more elements to iterate.
 E next()
          Returns the next object in the iteration.
 void remove()
          Removes the last object returned by next from the collection.
 

Method Detail

hasNext

boolean hasNext()
Returns if there are more elements to iterate.

Returns:
true if there are more elements, false otherwise
See Also:
next()

next

E next()
Returns the next object in the iteration.

Returns:
the next object
Throws:
NoSuchElementException - when there are no more elements
See Also:
hasNext()

remove

void remove()
Removes the last object returned by next from the collection.

Throws:
UnsupportedOperationException - when removing is not supported by the collection being iterated
IllegalStateException - when next has not been called, or remove has already been called after the last call to next

Build 1.0_r1(from source)

Please submit a feedback, bug or feature