generics
Interface StackADT<T>

All Known Implementing Classes:
Stack

public interface StackADT<T>


Method Summary
 int getSize()
          Returns the number of objects on the stack.
 boolean isEmpty()
          Tests if this stack is empty.
 boolean isFull()
          Tests if this stack is full.
 T peek()
          Returns the object at the top of this stack without removing it.
 T pop()
          Removes and returns the object at the top of this stack.
 void push(T x)
          Pushes an object onto the top of this stack.
 

Method Detail

push

void push(T x)
Pushes an object onto the top of this stack.

Parameters:
x - The object to be stored onto the stack.
Throws:
StackFullException - - if this stack is full

pop

T pop()
Removes and returns the object at the top of this stack.

Returns:
The object at the top of the stack.
Throws:
StackEmptyException - - if this stack is full

peek

T peek()
Returns the object at the top of this stack without removing it.

Returns:
The object at the top of the stack.
Throws:
StackEmptyException - - if this stack is full

isEmpty

boolean isEmpty()
Tests if this stack is empty.

Returns:
true if and only if this stack is empty; false otherwise.

isFull

boolean isFull()
Tests if this stack is full.

Returns:
true if and only if this stack is full; false otherwise.

getSize

int getSize()
Returns the number of objects on the stack.

Returns:
The number of objects on the stack.