Versions
Look up a class, method, property or event

CQueueIterator

Package system.collections
Inheritance class CQueueIterator
Implements Iterator, Traversable
Since 1.0
Version $Id: CQueueIterator.php 568 2009-01-23 22:50:14Z qiang.xue $
CQueueIterator implements an interator for CQueue.

It allows CQueue to return a new iterator for traversing the items in the queue.

Public Methods

Hide inherited methods

MethodDescriptionDefined 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

__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.

Be the first person to leave a comment

Please to leave your comment.