Iterator

Iterator
Array2Iterator
Array3Iterator
ArrayedQueueIterator
ArrayedStackIterator
9 other children

A ‘java-style’ iterator interface.

Summary
IteratorA ‘java-style’ iterator interface.
Functions
nextReturns the current item and moves the iterator to the next item in the collection.
hasNextChecks if a next item exists.
startMoves the iterator to the first item in the collection.
Properties
dataGrants access to the current item being referenced by the iterator.
data@private

Functions

next

function next():*

Returns the current item and moves the iterator to the next item in the collection.  Note that the next() method returns the first item in the collection when it’s first called.

Returns

The next item in the collection. 

hasNext

function hasNext():Boolean

Checks if a next item exists.

Returns

True if a next item exists, otherwise false. 

start

function start():void

Moves the iterator to the first item in the collection.

Properties

data

function get data():*

Grants access to the current item being referenced by the iterator.  This provides a quick way to read or write the current data.

data

function set data(obj: *):void

@private

function next():*
Returns the current item and moves the iterator to the next item in the collection.
function hasNext():Boolean
Checks if a next item exists.
function start():void
Moves the iterator to the first item in the collection.
function get data():*
Grants access to the current item being referenced by the iterator.
Close