|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a stack: a collection of objects that are inserted and removed according to the last-in first-out principle.
EmptyStackException
Method Summary | |
boolean |
isEmpty()
Return whether the stack is empty. |
Object |
pop()
Remove the top element from the stack. |
void |
push(Object element)
Insert an element at the top of the stack. |
int |
size()
Return the number of elements in the stack. |
Object |
top()
Inspect the element at the top of the stack. |
Method Detail |
public int size()
public boolean isEmpty()
public Object top() throws EmptyStackException
EmptyStackException
- if the stack is empty.public void push(Object element)
element
- element to be inserted.public Object pop() throws EmptyStackException
EmptyStackException
- if the stack is empty.
|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |