Class TinyStack

java.lang.Object
  |
  +--TinyStack

public class TinyStack
extends java.lang.Object

A little stack implementation.

Since:
JDK1.2

Constructor Summary
TinyStack()
          Creates an empty stack.
 
Method Summary
 boolean isEmpty()
          Checks whether stack is empty.
 java.lang.Object pop()
          Pops an object off the stack.
 void push(java.lang.Object o)
          Pushes an object onto the stack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TinyStack

public TinyStack()
Creates an empty stack.

Method Detail

isEmpty

public boolean isEmpty()
Checks whether stack is empty.

Returns:
true if stack is empty, false otherwise

push

public void push(java.lang.Object o)
Pushes an object onto the stack.

Parameters:
o - the object

pop

public java.lang.Object pop()
                     throws java.lang.IllegalStateException
Pops an object off the stack.

Returns:
the object currently on the top of the stack
Throws:
java.lang.IllegalStateException - if the stack is already empty