|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.adaptx.util.QuickStack
public class QuickStack
A representation of a Stack that does not use Synchronization. For compatibility this class supports the same methods as a java.util.Stack (JDK)
Nested Class Summary | |
---|---|
class |
QuickStack.StackIterator
|
Constructor Summary | |
---|---|
QuickStack()
Creates an empty Stack |
Method Summary | |
---|---|
boolean |
empty()
Tests for an empty Stack |
Iterator |
iterator()
Returns an Iterator for this Stack. |
java.lang.Object |
peek()
Returns the Object that is currently on top of the Stack. |
java.lang.Object |
pop()
Removes and returns the Object that is currently on top of the Stack. |
void |
push(java.lang.Object object)
Adds the given Object to the top of the Stack |
int |
search(java.lang.Object object)
Searches for the given Object in the stack and returns it's position relative to the top of the Stack (ie the number of calls to #pop() before the object is returned by #pop()) |
int |
size()
Returns the number of items on the Stack |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QuickStack()
Method Detail |
---|
public boolean empty()
public Iterator iterator()
public java.lang.Object peek() throws java.util.EmptyStackException
java.util.EmptyStackException
- when there are no
elements currently on the Stackpublic java.lang.Object pop() throws java.util.EmptyStackException
java.util.EmptyStackException
- when there are no
elements currently on the Stackpublic void push(java.lang.Object object)
public int search(java.lang.Object object)
public int size()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |