|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Stack
Constructor Summary | |
Stack()
Constructs a new stack object, initializing the stack to be empty |
Method Summary | |
boolean |
isEmpty()
Tells whether or not the stack is empty |
Object |
peek()
Returns the top element on the stack to the calling application, but does not remove it. |
Object |
pop()
Pops the top element off of the stack and returns it to the calling application. |
void |
push(Object item)
Adds the given item to the top of the stack |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Stack()
Method Detail |
public void push(Object item)
item
- The item to be added to the stackpublic boolean isEmpty()
public Object peek() throws java.util.EmptyStackException
public Object pop() throws java.util.EmptyStackException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |