public class Stack<T>
extends java.util.ArrayList<T>
Stack
based on ArrayList
(instead of Vector
)
and therefore is (1) not synchronized and (2) faster.Constructor and Description |
---|
Stack() |
Stack(java.util.Collection<? extends T> init) |
Stack(int initialCapacity) |
Stack(T... items) |
Modifier and Type | Method and Description |
---|---|
boolean |
empty() |
boolean |
equals(java.lang.Object o) |
T |
peek() |
T |
pop() |
void |
push(T t) |
T |
tryPop() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
public Stack()
public Stack(int initialCapacity)
public Stack(java.util.Collection<? extends T> init)
public Stack(T... items)