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