Implements the queue abstract data type. The last element added to this queue is
the last one to be returned from it.
Methods
Method push()
Adds another element to this queue.
Arguments
new_elements
the elements to be added to this queue
Method pop()
Returns the first added element to this queue and removes it
from this queue.
Returns
the first added element to this queue or NULL
if this queue is empty
Method empty()
Removes all elements from this queue.
Method size()
Returns the number of elements in this queue.
Returns
the number of elements in this queue
Returns an array of elements in this queue. The order of elements is chronological:
the first elements in the returned array is the oldest element added to this queue.
Usage
Queue$get(reversed = FALSE)
Arguments
reversed
(logical
)
if TRUE then returns the First-In-First-Out order; otherwise returns the Last-In-First-Out order.
Default: FALSE
Returns
the array of elements in this queue
Removes the eldest occurrence of elements from this queue. Relies on implicit
conversions of R types to compare a removed element with elements in this queue.
Arguments
elements
the elements to remove from this queue
Prints this queue.
Arguments
...
the additional arguments to this method, ignored
Method clone()
The objects of this class are cloneable with this method.
Usage
Queue$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.