| queue-class {filehash} | R Documentation |
Class "queue"
Description
A queue implementation using a filehash database
Objects from the Class
Objects can be created by calls of the form new("queue", ...) or
by calling createQ. Existing queues can be initialized with
initQ.
Slots
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)
Methods
- isEmpty
signature(db = "queue"): returnsTRUE/FALSEdepending on whether there are elements in the queue.- pop
signature(db = "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- push
signature(db = "queue"): adds an element to the tail ("bottom") of the queue- show
signature(object = "queue"): prints the name of the queue- top
signature(db = "queue"): returns the value of the "top" (i.e. head) of the queue; an error is signaled if the queue is empty
Author(s)
Roger D. Peng rpeng@jhsph.edu
Examples
showClass("queue")