DataStructures
Class StackList

java.lang.Object
  |
  +--DataStructures.StackList
All Implemented Interfaces:
Stack

public class StackList
extends java.lang.Object
implements Stack

A linked list implementation of a stack

Author:
Peter Williams

Constructor Summary
StackList()
           
 
Method Summary
 boolean isEmpty()
          Indicates the status of the stack.
 java.lang.Object pop()
          Pops an item off the stack.
 void push(java.lang.Object item)
          Pushes an item onto the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackList

public StackList()
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: Stack
Indicates the status of the stack.
Specified by:
isEmpty in interface Stack
Following copied from interface: DataStructures.Stack
Returns:
true if the stack is empty.

push

public void push(java.lang.Object item)
Description copied from interface: Stack
Pushes an item onto the stack.
Specified by:
push in interface Stack
Following copied from interface: DataStructures.Stack
Parameters:
item - the Object to be pushed.

pop

public java.lang.Object pop()
Description copied from interface: Stack
Pops an item off the stack.
Specified by:
pop in interface Stack
Following copied from interface: DataStructures.Stack
Returns:
the item most recently pushed onto the stack
Throws:
NoSuchElementException - if the stack is empty.