|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DataStructures.StackLi
List-based implementation of the stack.
Constructor Summary | |
StackLi()
Construct the stack. |
Method Summary | |
boolean |
isEmpty()
Test if the stack is logically empty. |
boolean |
isFull()
Test if the stack is logically full. |
static void |
main(java.lang.String[] args)
|
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 StackLi()
Method Detail |
public boolean isFull()
public boolean isEmpty()
public void makeEmpty()
public java.lang.Object top()
public void pop() throws Underflow
Underflow
- if the stack is empty.public java.lang.Object topAndPop()
public void push(java.lang.Object x)
x
- the item to insert.public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |