|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for a stack.
A stack is a collection of objects elements that are inserted and removed according to the last-in first-out principle.
StackEmptyException,
Queue,
Deque| Method Summary | |
boolean |
isEmpty()
Tests if the stack is empty |
java.lang.Object |
pop()
Remove the top element. |
void |
push(java.lang.Object element)
Insert an element at the top. |
int |
size()
Return the number of elements. |
java.lang.Object |
top()
Inspect the top element, without removing it or otherwise modifying the stack. |
| Method Detail |
public int size()
public boolean isEmpty()
true if the stack is empty, false
otherwise.
public java.lang.Object top()
throws StackEmptyException
public void push(java.lang.Object element)
element - new element to be inserted.
public java.lang.Object pop()
throws StackEmptyException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||