|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MyStack<E>
A stack-like interface.
Unfortunately, java.util.Stack uses a Vector, and is, therefore, needlessly synchronized in a non-multi-threaded environment. As a result, it was necessary to reimplement the stack in this manner by using a non-synchronized list.
Method Summary | |
---|---|
void |
clear()
Eliminate all items from the stack. |
E |
peek()
Inspect the top-most element without affecting the stack. |
E |
pop()
Pop an item off the stack and return that item to the callee. |
void |
push(E o)
Push an item onto the stack. |
int |
size()
|
Method Detail |
---|
void push(E o)
o
- The item to push onto the stack.E pop()
int size()
void clear()
E peek()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |