|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Stack<AnyType>
Protocol for stacks.
Method Summary | |
---|---|
boolean |
isEmpty()
Test if the stack is logically empty. |
void |
makeEmpty()
Make the stack logically empty. |
void |
pop()
Remove the most recently inserted item from the stack. |
void |
push(AnyType x)
Insert a new item into the stack. |
AnyType |
top()
Get the most recently inserted item in the stack. |
AnyType |
topAndPop()
Return and remove the most recently inserted item from the stack. |
Method Detail |
---|
void push(AnyType x)
x
- the item to insert.void pop()
UnderflowException
- if the stack is empty.AnyType top()
UnderflowException
- if the stack is empty.AnyType topAndPop()
UnderflowException
- if the stack is empty.boolean isEmpty()
void makeEmpty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |