dataStructures
Class FormulaStack

java.lang.Object
  |
  +--dataStructures.FormulaBasedLinearList
        |
        +--dataStructures.FormulaStack

public class FormulaStack
extends FormulaBasedLinearList
implements Stack


Fields inherited from class dataStructures.FormulaBasedLinearList
element, size
 
Constructor Summary
FormulaStack()
          create a stack with initial capacity 10
FormulaStack(int initialCapacity)
          create a stack with the given initial capacity
 
Method Summary
 boolean empty()
           
static void main(java.lang.String[] args)
          test program
 java.lang.Object peek()
           
 java.lang.Object pop()
          remove top element of stack and return it
 void push(java.lang.Object theElement)
          add theElement to the top of the stack
 
Methods inherited from class dataStructures.FormulaBasedLinearList
elementAt, elements, indexOf, insertElementAt, isEmpty, removeElementAt, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormulaStack

public FormulaStack(int initialCapacity)
create a stack with the given initial capacity

FormulaStack

public FormulaStack()
create a stack with initial capacity 10
Method Detail

empty

public boolean empty()
Specified by:
empty in interface Stack
Returns:
true iff stack is empty

peek

public java.lang.Object peek()
Specified by:
peek in interface Stack
Returns:
top element of stack

push

public void push(java.lang.Object theElement)
add theElement to the top of the stack
Specified by:
push in interface Stack

pop

public java.lang.Object pop()
remove top element of stack and return it
Specified by:
pop in interface Stack

main

public static void main(java.lang.String[] args)
test program