Queue
Class: Queue
@include <Queue>
Simple Queue implementation
Methods
@Queue.size
Scope: public
Echo the number of elements in the queue.
Outputs: The number of elements in the queue.
Usage: @Queue.size
@Queue.empty
Scope: public
Silently check if the queue is empty.
Returns: 0 if the queue is empty, 1 otherwise.
Outputs: nothing
Usage: @Queue.empty
@Queue.enqueue
Scope: public
Add a value to the end of the queue.
Usage: @Queue.enqueue $value
Parameters
value- Type:
Primitive - The value to add to the queue.
- Type:
@Queue.dequeue
Scope: public
Remove and echo the value at the front of the queue.
Returns: 1 if the queue is empty, 0 otherwise.
Outputs: The value at the front of the queue.
Usage: @Queue.dequeue
@Queue.front
Scope: public
Echo the value at the front of the queue.
Returns: 1 if the queue is empty, 0 otherwise.
Outputs: The value at the front of the queue.
Usage: @Queue.front
@Queue.back
Scope: public
Echo the value at the back of the queue.
Returns: 1 if the queue is empty, 0 otherwise.
Outputs: The value at the back of the queue.
Usage: @Queue.back
@Queue.clear
Scope: public
Clear the queue by removing all elements.
Usage: @Queue.clear