ForwardArrayIterator

ForwardArrayIterator

Iterates through an array by starting with ‘0’ and then incrementing the index until the array length is reached.

See Also

com.boostworthy.collections.iterators.IIterator

Summary
ForwardArrayIteratorIterates through an array by starting with ‘0’ and then incrementing the index until the array length is reached.
Variables
m_aDataHolds the array of data to be iterated through.
m_uIndexStores the current index for the iteration process.
Functions
ForwardArrayIteratorConstructor.
hasNextReturns a boolean value indicating whether or not the collection has another element beyond the current index.
nextReturns the element at the current index and then moves on to the next.
resetResets this iterator back to an index of ‘0’.

Variables

m_aData

private var m_aData: Array

Holds the array of data to be iterated through.

m_uIndex

private var m_uIndex: uint

Stores the current index for the iteration process.

Functions

ForwardArrayIterator

public function ForwardArrayIterator(aData: Array)

Constructor.

Parameters

param aData An array of data to be iterated through by this object. 

hasNext

public function hasNext():Boolean

Returns a boolean value indicating whether or not the collection has another element beyond the current index.

Returns

A boolean value indicating whether or not the collection has another element beyond the current index. 

next

public function next():Object

Returns the element at the current index and then moves on to the next.

Returns

The element at the current index. 

reset

public function reset():void

Resets this iterator back to an index of ‘0’.

The ‘IIterator’ interface defines a common interface for all iterator objects.
private var m_aData: Array
Holds the array of data to be iterated through.
private var m_uIndex: uint
Stores the current index for the iteration process.
public function ForwardArrayIterator(aData: Array)
Constructor.
public function hasNext():Boolean
Returns a boolean value indicating whether or not the collection has another element beyond the current index.
public function next():Object
Returns the element at the current index and then moves on to the next.
public function reset():void
Resets this iterator back to an index of ‘0’.
Close