|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface SimpleStack<E>
Interface for stacks. (This provides a common interface for potentially different implementations, but you could certainly write a stack class without it.)
| Method Summary | |
|---|---|
boolean |
empty()
Tells whether stack is empty. |
E |
pop()
Pops an element from the stack. |
void |
push(E x)
Pushes an element onto the stack. |
E |
top()
Gets the top element of the stack (but does not remove it). |
| Method Detail |
|---|
boolean empty()
void push(E x)
throws StackFullException
x - element to add
StackFullException - if stack is already full
E pop()
throws StackEmptyException
StackEmptyException - if stack is empty
E top()
throws StackEmptyException
StackEmptyException - if stack is empty
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||