stack-class {filehash} | R Documentation |
Stack Class
Description
A stack implementation using a filehash
database
Usage
## S4 method for signature 'stack'
show(object)
createS(filename)
initS(filename)
## S4 method for signature 'stack'
push(db, val, ...)
mpush(db, vals, ...)
## S4 method for signature 'stack'
mpush(db, vals, ...)
## S4 method for signature 'stack'
isEmpty(db, ...)
## S4 method for signature 'stack'
top(db, ...)
## S4 method for signature 'stack'
pop(db, ...)
Arguments
object |
a stack object |
filename |
name of file where stack is stored |
db |
a stack object |
val |
an R object to be added to the stack |
... |
arguments passed to other methods |
vals |
a list of R objects |
Details
Objects can be created by calls of the form new("stack", ...)
or by calling createS
. Existing queues can be initialized with initS
.
Value
a stack object
Methods (by generic)
-
show(stack)
: Print a stack object. -
push(stack)
: Push an object on to the stack -
mpush(stack)
: Push a list of R objects on to the stack -
isEmpty(stack)
: Indicate whether the stack is empty or not -
top(stack)
: Return the top element of the stack -
pop(stack)
: Return the top element of the stack and remove that element from the stack
Functions
-
createS()
: Create a filehash Stack -
initS()
: Initialize and existing filehash stack -
mpush()
: Push multiple R objects on to a stack
Slots
stack
Object of class
"filehashDB1"
name
Object of class
"character"
: the name of the stack (default is the file name in which the stack data are stored)