|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of data that the stack stores.public interface Stack<T>
An interface for the Stack ADT.
Method Summary | |
---|---|
void |
clear()
Removes all items from the stack. |
boolean |
isEmpty()
Returns true if the stack is empty. |
T |
peek()
Returns the item on top of the stack, without removing it. |
T |
pop()
Removes the item from the top of this stack, and returns it. |
void |
push(T item)
Adds an item to the top of this stack. |
Method Detail |
---|
void push(T item)
item
- The item to add.T pop()
T peek()
boolean isEmpty()
void clear()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |