|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jwarp.util.Stack
This is a simple stack. I would have liked to use java.util.Stack, but I need a stack that returns "null" when the Stack is empty, rather than throwing an exception.
| Field Summary | |
protected java.util.LinkedList |
stack
The underlying linked list |
| Constructor Summary | |
Stack()
|
|
| Method Summary | |
void |
clear()
Clear the stack (removes all elements) |
boolean |
isEmpty()
Return if the stack is empty |
java.lang.Object |
pop()
Pops an object from the stacks |
void |
push(java.lang.Object o)
Push a new element onto the stack. |
int |
size()
Get the current stack size |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.util.LinkedList stack
| Constructor Detail |
public Stack()
| Method Detail |
public void push(java.lang.Object o)
o - The new objectpublic java.lang.Object pop()
public int size()
public boolean isEmpty()
public void clear()
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||