Packageorg.as3collections
Interfacepublic interface IIterator
Implementors ArrayIterator, MapIterator

An iterator over a collection.



Public Methods
 MethodDefined By
  
hasNext():Boolean
Returns true if the iteration has more elements.
IIterator
  
next():*
Returns the next element in the iteration.
IIterator
  
Returns the internal pointer of the iteration.
IIterator
  
remove():void
Removes from the underlying collection the last element returned by the iterator (optional operation).
IIterator
  
reset():void
Resets the internal pointer of the iterator.
IIterator
Method Detail
hasNext()method
public function hasNext():Boolean

Returns true if the iteration has more elements.

Returns
Booleantrue if the iteration has more elements.
next()method 
public function next():*

Returns the next element in the iteration.

Returns
* — the next element in the iteration.

Throws
NoSuchElementError — if the iteration has no more elements.
pointer()method 
public function pointer():*

Returns the internal pointer of the iteration.

In a list or queue, the pointer should be the index (position) of the iteration, typically an int.

In a map, the pointer should be the key of the iteration.

Returns
* — the internal pointer of the iteration.
remove()method 
public function remove():void

Removes from the underlying collection the last element returned by the iterator (optional operation).

This method can be called only once per call to next.


Throws
org.as3coreaddendum.errors:UnsupportedOperationError — if the remove operation is not supported by this iterator.
 
org.as3coreaddendum.errors:IllegalStateError — if the next method has not yet been called, or the remove method has already been called after the last call to the next method.
reset()method 
public function reset():void

Resets the internal pointer of the iterator.