Package | com.ericfeminella.collections |
Class | public class ArrayIterator |
Implements | Iterator |
Array
.
var array:Array = new Array( "A", "B", "C" ); var it:Iterator = new ArrayIterator( array ); while ( it.hasNext() ) { trace( it.next(), it.position()); } //outputs: //A, 0 //B, 1 //C, 2
See also
Method | Defined by | ||
---|---|---|---|
ArrayIterator(array:Array = null)
Instantiates a new
ArrayIterator instance
| ArrayIterator | ||
hasNext():Boolean
Determines if elements remain in the
Array . | ArrayIterator | ||
next():*
Returns the next item element in the
Array . | ArrayIterator | ||
position():int
Determines the indexed position of the
Array . | ArrayIterator | ||
reset():void
Resets the index of the
ArrayIterator
instance to 0. | ArrayIterator |
ArrayIterator | () | constructor |
public function ArrayIterator(array:Array = null)
Instantiates a new ArrayIterator
instance
array:Array (default = null ) — Array in which to iterate over
|
hasNext | () | method |
public function hasNext():Boolean
Determines if elements remain in the Array
.
Determines if there are elements remaining in the
aggregate.
Boolean — true if an element remains, false if not
|
next | () | method |
public function next():*
Returns the next item element in the Array
.
* — next array element based on the current index
|
position | () | method |
public function position():int
Determines the indexed position of the Array
.
int |
reset | () | method |
public function reset():void
Resets the index of the ArrayIterator
instance to 0.