Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

queue-class

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"): returns TRUE/FALSE depending 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")

filehash

Simple Key-Value Database

v2.4-2
GPL (>= 2)
Authors
Roger D. Peng <rdpeng@jhu.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.