openlist
Class Stack<Type>

java.lang.Object
  extended by openlist.Stack<Type>

public class Stack<Type>
extends java.lang.Object

A Stack is a last-in, first-out repository.


Field Summary
private  OpenList<Type> stack
           
 
Constructor Summary
Stack()
          Create an empty Stack.
 
Method Summary
 boolean isEmpty()
          Indicate whether or not the stack is empty
 boolean nonEmpty()
          Indicate whether or not the stack is non-empty
 Type pop()
          Pop an item from the Stack.
 void push(Type item)
          Push one item to the Stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

private OpenList<Type> stack
Constructor Detail

Stack

public Stack()
Create an empty Stack.

Method Detail

push

public void push(Type item)
Push one item to the Stack.

Parameters:
item - the item to be pushed

pop

public Type pop()
Pop an item from the Stack.

Returns:
the popped item

isEmpty

public boolean isEmpty()
Indicate whether or not the stack is empty

Returns:
true if the stack is empty, otherwise false

nonEmpty

public boolean nonEmpty()
Indicate whether or not the stack is non-empty

Returns:
true if the stack is non-empty, otherwise false