|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ListStack.Stack
Stack models a stack data structure (using a linked list)
Constructor Summary | |
Stack()
Constructor Stack creates an empty stack. |
Method Summary | |
boolean |
isEmpty()
isEmpty states whether the stack has 0 elements. |
java.lang.Object |
pop()
pop removes the most recently added element |
void |
push(java.lang.Object ob)
push inserts a new element onto the stack |
java.lang.Object |
top()
top returns the identity of the most recently added element |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Stack()
Method Detail |
public void push(java.lang.Object ob)
ob
- - the element to be addedpublic java.lang.Object pop()
public java.lang.Object top()
public boolean isEmpty()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |