|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jb.Stack
The Stack class represents a last-in-first-out stack of objects.
Constructor Summary | |
Stack()
|
Method Summary | |
boolean |
isEmpty()
Tests if this stack is empty. |
java.lang.Object |
peek()
Returns the object at the top of this stack without removing it. |
java.lang.Object |
pop()
Removes the object at the top of this stack and returns that object. |
void |
push(java.lang.Object item)
Pushes an item on to the top of this 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(java.lang.Object item)
item
- the item to be pushed.public java.lang.Object pop() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if this stack is empty.public java.lang.Object peek() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if this stack is empty.public boolean isEmpty()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |