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 |
|---|---|
Stack<E> |
copy() |
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.
|
E[] |
toArray() |
createDefaultIterator, getElementAtIndex, getElementsInRange, getIndexOfElement, getNumberOfElements, removeAllElementscompareTo, containsAllElementsIn, containsAnyElementsIn, containsElement, equals, hashCode, isEmpty, iterator, normalizedIndexaddSerializableClass, addSerializableClass, toExposedString, toString, toStringpublic Stack()
public Stack(int capacity)
capacity - The maximum number of elements that can be on the stack
at one time.public E[] toArray()
toArray in interface Sequential<E>toArray in class Collection<E>public Stack<E> copy()
copy in class craterdog.smart.SmartObject<Collection<E>>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 © 2015 Crater Dog Technologies(TM). All rights reserved.