|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--magi.toolkit.util.queue.Stack
An implementation of a stack, for pushing and popping objects. The Stack implements the Queue interface, as a Stack can be considered to be a LIFO Queue implementation.
Constructor Summary | |
Stack()
Default constructor. |
|
Stack(java.lang.Object[] objects)
Creates a Stack pre-populated with an array of Objects. |
Method Summary | |
boolean |
isEmpty()
Returns true if the stack currently contains no elements. |
java.lang.Object |
peek()
Peek at the next Object available on the stack. |
java.lang.Object[] |
peekAll()
Peek at all Objects available in the stack, in the correct stacking order. |
java.lang.Object |
pop()
Pops an Object off the stack. |
java.lang.Object[] |
popAll()
Pops all Objects off the stack, in the correct stacking order. |
void |
push(java.lang.Object object)
Pushes an Object onto the stack. |
void |
pushAll(java.lang.Object[] objects)
Pushes an array of Objects onto the stack. |
void |
remove(java.lang.Object object)
Removes an Object directly from this stack, regardless of its current position in the stack. |
int |
size()
Returns the number of Objects currently in the stack. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Stack()
public Stack(java.lang.Object[] objects)
Method Detail |
public void push(java.lang.Object object)
push
in interface Queue
object
- the Object to insert.public void pushAll(java.lang.Object[] objects)
pushAll
in interface Queue
objects
- the Object array to queue up.public java.lang.Object pop()
pop
in interface Queue
public java.lang.Object[] popAll()
popAll
in interface Queue
public java.lang.Object peek()
peek
in interface Queue
public java.lang.Object[] peekAll()
peekAll
in interface Queue
public int size()
size
in interface Queue
public boolean isEmpty()
isEmpty
in interface Queue
public void remove(java.lang.Object object)
remove
in interface Queue
object
- the Object to remove.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |