Add docs for createQ/initQ and createS/initS
[filehash.git] / man / stack-class.Rd
blob8fbddb87a9e3d789826bb2f930bdcdcfe8fb855b
1 \name{stack-class}
2 \docType{class}
3 \alias{stack-class}
4 \alias{isEmpty,stack-method}
5 \alias{mpush,stack-method}
6 \alias{pop,stack-method}
7 \alias{push,stack-method}
8 \alias{show,stack-method}
9 \alias{top,stack-method}
11 \title{Class "stack"}
12 \description{A stack implementation using a \code{filehash} database}
13 \section{Objects from the Class}{
14 Objects can be created by calls of the form \code{new("stack", ...)} or
15 by calling \code{createS}.  Existing queues can be initialized with
16 \code{initS}.
18 \section{Slots}{
19   \describe{
20     \item{\code{stack}:}{Object of class \code{"filehashDB1"}}
21     \item{\code{name}:}{Object of class \code{"character"}: the name of
22       the stack (default is the file name in which the stack data are
23       stored)}
24   }
26 \section{Methods}{
27   \describe{
28     \item{isEmpty}{\code{signature(db = "stack")}: returns
29       \code{TRUE}/\code{FALSE} depending on whether there are elements
30       in the stack.}
31     \item{pop}{\code{signature(db = "stack")}: returns the value of the
32       top of the stack and subsequently removes that
33       element from the stack; an error is signaled if the stack is empty}
34     \item{push}{\code{signature(db = "stack")}: adds an element to the
35       top of the stack}
36     \item{show}{\code{signature(object = "stack")}: prints the name of
37       the stack}
38     \item{top}{\code{signature(db = "stack")}: returns the value of the
39       top of the stack; an error is signaled if the stack
40       is empty}
41     \item{mpush}{\code{signature(db = "stack")}: works like \code{push}
42       except it can push multiple objects in a list on to the stack}
43   }
45 \author{Roger D. Peng \email{rpeng@jhsph.edu}}
47 \examples{
48 showClass("stack")
50 \keyword{classes}