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 |
---|
cIterator(\$aItems $aItems) : \none
This function initializes the constructor, adds the passed items and moves the iterator to the first element.
\$aItems
array Items to add
\none
count() : int
int
Number of itemsnext() : mixed
This function returns the item, or false if no items are left.
mixed
item or false if nothing was foundreset() : \none
This function moves the iterator to the first element
\none
$_aIteratorItems : array