CListIterator
| Package | system.collections |
|---|---|
| Inheritance | class CListIterator |
| Implements | Iterator, Traversable |
| Since | 1.0 |
| Version | $Id: CListIterator.php 1678 2010-01-07 21:02:00Z qiang.xue $ |
CListIterator implements an interator for CList.
It allows CList to return a new iterator for traversing the items in the list.
It allows CList to return a new iterator for traversing the items in the list.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Constructor. | CListIterator |
| current() | Returns the current array item. | CListIterator |
| key() | Returns the key of the current array item. | CListIterator |
| next() | Moves the internal pointer to the next array item. | CListIterator |
| rewind() | Rewinds internal array pointer. | CListIterator |
| valid() | Returns whether there is an item at current position. | CListIterator |
Method Details
__construct()
method
|
public void __construct(array $data)
| ||
| $data | array | the data to be iterated through |
Constructor.
current()
method
|
public mixed current()
| ||
| {return} | mixed | the current array item |
Returns the current array item. This method is required by the interface Iterator.
key()
method
|
public integer key()
| ||
| {return} | integer | the key of the current array item |
Returns the key of the current array item. This method is required by the interface Iterator.
next()
method
|
public void next()
|
Moves the internal pointer to the next array item. This method is required by the interface Iterator.
rewind()
method
|
public void rewind()
|
Rewinds internal array pointer. This method is required by the interface Iterator.
valid()
method
|
public boolean valid()
| ||
| {return} | boolean | |
Returns whether there is an item at current position. This method is required by the interface Iterator.