|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ksu.cis.viewer.Stack
A stack built from an immutable ConsList
. Using an
immutable structure
for the underlying storage allows a shallow clone to be sufficient.
Constructor Summary | |
Stack()
Constructs an empty Stack. |
Method Summary | |
Object |
clone()
Returns a clone of this stack. |
boolean |
empty()
Returns true if the stack is empty. |
Object |
pop()
Removes the Object from the top of the stack and returns it. |
void |
push(Object obj)
Pushes the given Object onto the top of the stack. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Stack()
Method Detail |
public void push(Object obj)
public Object pop() throws EmptyStackException
EmptyStackException
- If the stack is empty.public boolean empty()
public Object clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |