E - The type of element managed by this collection.public class Stack<E> extends ClosedCollection<E> implements LIFO<E>
list| Constructor and Description |
|---|
Stack()
This constructor creates a new stack of unlimited capacity.
|
Stack(int capacity)
This constructor creates a new stack with the specified capacity.
|
| Modifier and Type | Method and Description |
|---|---|
E |
getTopElement()
This method returns a reference to the top element on the stack without
removing it from the stack.
|
E |
popElementOffTop()
This method pops the top element off of the stack.
|
void |
pushElementOnTop(E element)
This method pushes a new element onto the top of the stack.
|
createDefaultIterator, getElementAtIndex, getElementsInRange, getIndexOfElement, getNumberOfElements, removeAllElementscompareTo, containsAllElementsIn, containsAnyElementsIn, containsElement, equals, hashCode, isEmpty, iterator, normalizedIndex, toArray, toArray, toString, toStringpublic Stack()
public Stack(int capacity)
capacity - The maximum number of elements that can be on the stack
at one time.public final void pushElementOnTop(E element)
LIFOpushElementOnTop in interface LIFO<E>element - The new element to be added.public final E popElementOffTop()
LIFOpopElementOffTop in interface LIFO<E>public final E getTopElement()
LIFOgetTopElement in interface LIFO<E>Copyright © 2014 Crater Dog Technologies(TM). All rights reserved.