E - The type of element managed by this collection.public class Stack<E> extends ClosedCollection<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 |
getTop()
This method returns a reference to the top element on the stack without
removing it from the stack.
|
E |
popElement()
This method pops the top element off of the stack.
|
void |
pushElement(E element)
This method pushes a new element onto the top of the stack.
|
E[] |
toArray() |
createIterator, getElement, getElements, getIndex, getSize, removeAllcontainsAll, containsAny, containsElement, normalizedIndexcompareTo, equals, hashCodeaddSerializableClass, addSerializableClass, addSerializableClass, createMapper, fromString, fromString, toExposedString, toString, toString, 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()
public final void pushElement(E element)
element - The new element to be added.public final E popElement()
public final E getTop()
Copyright © 2016 Crater Dog Technologies(TM). All rights reserved.