Queue | R Documentation |
Abstract data type that stores and returns any number of elements.
A Queue
object stores all elements in a single vector,
thus all data types can be stored, but silent coercion may occur.
Elements are returned in the same order that they were added.
push()
Adds element(s) to Queue
.
Queue$push(new_elements)
new_elements
vector of elements to add.
self
, invisibly.
get()
Returns all contents of the Queue
object.
Queue$get()
Single vector containing all Queue
contents.
pop()
Returns the first (oldest) element of the Queue
and removes it.
Queue$pop()
vector of length 1 containing the first element of Queue
or NULL
if Queue
is empty.
remove()
Removes the oldest occurrence of specified element(s) from Queue
.
Relies on implicit type conversions of R identify elements to remove.
Queue$remove(elements)
elements
vector of elements to remove from Queue
.
self
, invisibly.
empty()
Removes all elements from Queue
.
Queue$empty()
self
, invisibly.
size()
Returns the number of elements in Queue
.
Queue$size()
integer(1)
.
print()
Prints this Queue
.
Queue$print(...)
...
Additional arguments to this method, ignored.
self
, invisibly.
clone()
The objects of this class are cloneable with this method.
Queue$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.