cIterator: A class which represents the C/C++/JAVA Iterator support.

Iterating items is a mechanism to "step" trough a list of defined items. Basically, the iterator is similar to an array, but provides easy functions to step trough the list.

An instance of an iterator is usually created by a class returning multiple items and automatically filled using the $aItems parameter of the constructor, and then returned to the caller.

The caller receives the iterator object and can step trough all items using the "next" method.

todo Add more stepping methods, as well as retrieving items

 Methods

Iterator constructor

cIterator(\$aItems $aItems) : \none

This function initializes the constructor, adds the passed items and moves the iterator to the first element.

Parameters

$aItems

\$aItems

array Items to add

Returns

\none

count: Returns the number of items in the iterator

count() : int

Returns

intNumber of items

reset: Resets the iterator to the first element

reset() : \none

This function moves the iterator to the first element

Returns

\none

 Properties

 

Holds the items which should be iterated

$_aIteratorItems : array