|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Stack<T>
Interface representing a last-in, first-out (LIFO) stack when unsorted, and a priority stack when sorted.
Nested Class Summary | |
---|---|
static class |
Stack.StackListenerList<T>
Stack listener list. |
Method Summary | |
---|---|
int |
getDepth()
Returns the stack depth. |
ListenerList<StackListener<T>> |
getStackListeners()
Returns the stack listener list. |
boolean |
isEmpty()
Tests the emptiness of the stack. |
T |
peek()
Returns the item on top of the stack without removing it from the stack. |
T |
pop()
Removes the top item from the stack and returns it. |
void |
push(T item)
"Pushes" an item onto the stack. |
Methods inherited from interface org.apache.pivot.collections.Collection |
---|
clear, getComparator, setComparator |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
void push(T item)
item
- The item to push onto the stack.T pop()
IllegalStateException
- If the stack contains no items.T peek()
boolean isEmpty()
isEmpty
in interface Collection<T>
int getDepth()
ListenerList<StackListener<T>> getStackListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |