|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Stack
Stack implements a stack of non-null
objects. The
stack is implemented as a conslist.
Constructor Summary | |
Stack()
Constructs the empty stack. |
Method Summary | |
void |
clear()
Clears the stack. |
boolean |
empty()
Reports if the stack is empty. |
java.lang.Object |
peek()
Peeks at the object at the top of the stack without removing it. |
java.lang.Object |
pop()
Removes the object at the top of the stack. |
void |
push(java.lang.Object obj)
Adds an object to the stack. |
int |
size()
The number of elements on 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(java.lang.Object obj)
obj
- the object that will be pushed onto the stack.public java.lang.Object pop()
null
if the stack is empty.public java.lang.Object peek()
null
if the stack is empty.public boolean empty()
true
if the stack is empty,
false
otherwise.public int size()
public void clear()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |