|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--weiss.nonstandard.ArrayStack
Array-based implementation of the stack.
| Constructor Summary | |
ArrayStack()
Construct the stack. |
|
| Method Summary | |
boolean |
isEmpty()
Test if the stack is logically empty. |
void |
makeEmpty()
Make the stack logically empty. |
void |
pop()
Remove the most recently inserted item from the stack. |
void |
push(java.lang.Object x)
Insert a new item into the stack. |
java.lang.Object |
top()
Get the most recently inserted item in the stack. |
java.lang.Object |
topAndPop()
Return and remove the most recently inserted item from the stack. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArrayStack()
| Method Detail |
public boolean isEmpty()
isEmpty in interface Stackpublic void makeEmpty()
makeEmpty in interface Stackpublic java.lang.Object top()
top in interface StackUnderflowException - if the stack is empty.public void pop()
pop in interface StackUnderflowException - if the stack is empty.public java.lang.Object topAndPop()
topAndPop in interface StackUnderflow - if the stack is empty.public void push(java.lang.Object x)
push in interface Stackx - the item to insert.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||