CQueueIterator
CQueueIterator implements an iterator for
CQueue.
It allows CQueue to return a new iterator for traversing the items in the queue.
Public Methods
Method |
Description |
Defined By |
__construct() | Constructor. | CQueueIterator |
current() | Returns the current array item. | CQueueIterator |
key() | Returns the key of the current array item. | CQueueIterator |
next() | Moves the internal pointer to the next array item. | CQueueIterator |
rewind() | Rewinds internal array pointer. | CQueueIterator |
valid() | Returns whether there is an item at current position. | CQueueIterator |
Method Details
public void __construct(array &$data) |
$data | array | the data to be iterated through |
Constructor.
public mixed current() |
{return} | mixed | the current array item |
Returns the current array item. This method is required by the interface Iterator.
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.
Moves the internal pointer to the next array item. This method is required by the interface Iterator.
Rewinds internal array pointer. This method is required by the interface Iterator.
public boolean valid() |
{return} | boolean | |
Returns whether there is an item at current position. This method is required by the interface Iterator.