public class FixedStack<T>
extends java.util.Stack<T>
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_MAX_SIZE
Default maximum stack size
|
private int |
max |
Constructor and Description |
---|
FixedStack()
Create a FixedStack with the
default maximum stack size |
FixedStack(int max)
Create a FixedStack with the given max stack size
|
Modifier and Type | Method and Description |
---|---|
int |
getMax() |
T |
push(T object) |
int |
setMax(int max)
Set the maximum size of this stack
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
private static final int DEFAULT_MAX_SIZE
private int max
public FixedStack()
default maximum stack size
public FixedStack(int max)
max
- The maximum stack size