ReverseArrayIterator

ReverseArrayIterator

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

See Also

com.boostworthy.collections.iterators.IIterator

Summary
ReverseArrayIteratorIterates through an array by starting with the array length and then decrementing the index until ‘0’ is reached.
Variables
m_aDataHolds the array of data to be iterated through.
m_uIndexStores the current index for the iteration process.
Functions
ReverseArrayIteratorConstructor.
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 the last index of the array.

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

ReverseArrayIterator

public function ReverseArrayIterator(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 the last index of the array.

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 ReverseArrayIterator(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 the last index of the array.
Close