|
||||||||||
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 |
---|
Nested classes/interfaces inherited from interface pivot.collections.List |
---|
List.ListListenerList<T> |
Nested classes/interfaces inherited from interface pivot.collections.Sequence |
---|
Sequence.Search, Sequence.Sort, Sequence.Tree |
Method Summary | |
---|---|
T |
peek()
Returns the item on top of the stack without removing it from the stack. |
T |
poke(T item)
Replaces the item on top of 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 pivot.collections.List |
---|
add, clear, getLength, getListListeners, insert, remove, setComparator, update |
Methods inherited from interface pivot.collections.Sequence |
---|
get, indexOf, remove |
Methods inherited from interface pivot.collections.Collection |
---|
getComparator |
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()
T poke(T item)
IllegalStateException
- If the stack contains no items.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |