Class CQueue
CQueue implements a queue.
The typical queue operations are implemented, which include CQueue::enqueue()
, CQueue::dequeue()
and CQueue::peek()
. In addition, CQueue::contains()
can be used to check if an item is contained in the queue. To obtain
the number of the items in the queue, check the getCount Count
property.
Items in the queue may be traversed using foreach as follows,
foreach($queue as $item) ...
- CComponent
- CQueue implements IteratorAggregate, Countable
Package: system\collections
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/collections/CQueue.php
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/collections/CQueue.php
public
|
#
__construct( array $data = null )
Constructor. Initializes the queue with an array or an iterable object. |
public
array
|
|
public
|
|
public
|
|
public
boolean
|
|
public
mixed
|
|
public
mixed
|
|
public
|
|
public
|
#
getIterator( )
Returns an iterator for traversing the items in the queue. This method is required by the interface IteratorAggregate. |
public
integer
|
|
public
integer
|
public
|
$iterator |
#
An iterator for traversing the items in the queue. |
public
integer
|
$count |
#
The number of items in the queue. |