Package java.util

Interface Iterator

All containers have methods to put objects in and get objects out. An iterator is an object used to get elements out of a container and present them to the user. Via the iterator abstraction the container simply appears to be a sequence.

An object that implements the Iterator interface generates a series of elements, one at a time. Calls to the next method return successive elements of the series, i.e. an iterator over an collection allows to walk through the elements in the collection in a well defined way, allowing also to remove elements (in contrast to Enumeration).

Every container allows to retreive an iterator to move through the elements in the container.

_INSERT_CONSTRUCTOR_ENTRY_HERE_

Public Methods

_INSERT_INHERITED_METHOD_ENTRY_HERE_

_INSERT_FIELDS_ENTRY_HERE_

Examples

Iterator it = MyHashMap.entrySet().iterator(); // get HashMap iterator

Iterator it = MyArrayList.iterator(); // get ArrayList iterator

Iterator it = MyHashSet.iterator(); // get HashSet iterator