Packagecom.ericfeminella.utils.iterators
Interfacepublic interface IIterator
ImplementorsArrayIterator, CollectionIterator, ObjectIterator

Defines the contract for concrete IIterator implementations which must provide an API for traversing an aggregate



Public Methods
 MethodDefined by
  
hasNext():Boolean
Determines if there are elements remaining in the aggregate
IIterator
  
next():*
Retrieves the next element in the aggregate
IIterator
  
position():int
Determines the position of the current element in the aggreagate
IIterator
  
reset():void
Resets the cursor / index of the Iterator to 0
IIterator
  
setAggregate(aggregate:Object = null):void
Sets the aggregate object in which to iterator over
IIterator
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

setAggregate()method 
public function setAggregate(aggregate:Object = null):void

Sets the aggregate object in which to iterator over

Parameters
aggregate:Object (default = null) — aggregate instance