|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectMysteryStackImplementation<T>
T - The type of data that the stack stores.public class MysteryStackImplementation<T>
An implementation of the Stack ADT.
| Constructor Summary | |
|---|---|
MysteryStackImplementation()
Default constructor: creates an empty stack. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all items from the stack. |
boolean |
isEmpty()
Returns true if the stack is empty. |
static void |
main(java.lang.String[] args)
|
T |
peek()
Return the top item from the stack but don't remove it. |
T |
pop()
Remove the top item from the stack and return it. |
void |
push(T item)
Store an item in the stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MysteryStackImplementation()
| Method Detail |
|---|
public void push(T item)
push in interface Stack<T>item - The item to add.public T pop()
pop in interface Stack<T>public T peek()
peek in interface Stack<T>public boolean isEmpty()
Stack
isEmpty in interface Stack<T>public void clear()
Stack
clear in interface Stack<T>public static void main(java.lang.String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||