DataStructures
Interface Stack<E>

Type Parameters:
E - the type of elements held in this stack
All Known Implementing Classes:
StackArray, StackList

public interface Stack<E>

A last-in-first-out (LIFO) stack of objects.

Author:
Peter Williams

Method Summary
 boolean isEmpty()
          Indicates the status of the stack.
 E pop()
          Pops an item off the stack.
 void push(E item)
          Pushes an item onto the stack.
 

Method Detail

isEmpty

boolean isEmpty()
Indicates the status of the stack.

Returns:
true if the stack is empty.

push

void push(E item)
Pushes an item onto the stack.

Parameters:
item - the item of type E to be pushed.

pop

E pop()
Pops an item off the stack.

Returns:
the item most recently pushed onto the stack
Throws:
NoSuchElementException - if the stack is empty.