Class \Prado\Collections\TQueue
TQueue class
TQueue implements a queue.
The typical queue operations are implemented, which include enqueue(), dequeue() and peek(). In addition, 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 \Prado\Collections\getCount property.
Items in the queue may be traversed using foreach as follows,
foreach($queue as $item) ...
Class hierarchy
- \Prado\Collections\TQueue implements IteratorAggregate, Countable
- \Prado\TComponent
Author: Knut Urdalen <knut.urdalen@gmail.com>
Since: 3.1
public
|
__construct([null|array<string|int, mixed>|Iterator $data = null ]) : mixed
Constructor.
Initializes the queue with an array or an iterable object. |
public
|
|
public
|
|
public
|
copyFrom(mixed $data) : mixed
Copies iterable data into the queue.
Note, existing data in the list will be cleared first. |
public
|
count() : int
Returns the number of items in the queue.
This method is required by \Countable interface. |
public
|
|
public
|
|
public
|
|
public
|
getIterator() : Iterator
Returns an iterator for traversing the items in the queue.
This method is required by the interface \IteratorAggregate. |
public
|
peek() : mixed
Returns the first item at the front of the queue.
Unlike dequeue(), this method does not remove the item from the queue. |
public
|
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |