queue-class | R Documentation |
A queue implementation using a filehash
database
createQ(filename)
initQ(filename)
pop(db, ...)
push(db, val, ...)
isEmpty(db, ...)
top(db, ...)
## S4 method for signature 'queue'
show(object)
## S4 method for signature 'queue'
push(db, val, ...)
## S4 method for signature 'queue'
isEmpty(db)
## S4 method for signature 'queue'
top(db, ...)
## S4 method for signature 'queue'
pop(db, ...)
filename |
name of queue file |
db |
a queue object |
... |
arguments passed to other methods |
val |
an R object to be added to the tail queue |
object |
a queue object |
Objects can be created by calls of the form new("queue", ...)
or by calling createQ
. Existing queues can be initialized with initQ
.
createQ
and initQ
return a queue
object
show(queue)
: Print a queue object
push(queue)
: adds an element to the tail ("bottom") of the queue
isEmpty(queue)
: returns TRUE
/FALSE
depending on whether there are elements in the queue.
top(queue)
: returns the value of the "top" (i.e. head) of the queue; an error is signaled if the queue is empty
pop(queue)
: returns the value of the "top" (i.e. head) of the queue and subsequently removes that element from the queue; an error is signaled if the queue is empty
createQ()
: Create a file-based queue object
initQ()
: Intialize an existing queue object
pop()
: Return (and remove) the top element of a queue
push()
: Push an R object on to the tail of a queue
isEmpty()
: Check if a queue is empty or not
top()
: Return the top of the queue
queue
Object of class "filehashDB1"
name
Object of class "character"
: the name of the queue (default is the file name in which the queue data are stored)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.