Packagecom.ericfeminella.collections
Interfacepublic interface Iterator
ImplementorsArrayIterator, CollectionIterator, StringTokenizer

Defines the contract for object which are to provide an API for traversing an aggregate object.

Iterator provides a set of standard operations which allow client implementations to manage the traversal of an aggregate object. Iterator implementations are not to modify an aggregate, but rather they are to simply provide an interface into the aggregate.



Public Methods
 MethodDefined by
  
hasNext():Boolean
Determines if there are elements remaining in the aggregate.
Iterator
  
next():*
Retrieves the next element in the aggregate.
Iterator
  
position():int
Determines the position of the current element in the aggreagate.
Iterator
  
reset():void
Resets the cursor / index of the Iterator to 0.
Iterator
Method detail
hasNext()method
public function hasNext():Boolean

Determines if there are elements remaining in the aggregate.

Returns
Boolean — true if an element remains, false if not
next()method 
public function next():*

Retrieves the next element in the aggregate.

Returns
* — next element based on the current index
position()method 
public function position():int

Determines the position of the current element in the aggreagate.

Returns
int — the current index of the aggreagate
reset()method 
public function reset():void

Resets the cursor / index of the Iterator to 0.