Package org.chsrobotics.lib.util
Class SizedStack<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
java.util.Stack<T>
org.chsrobotics.lib.util.SizedStack<T>
- Type Parameters:
T
- Data type contained by the stack.
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
Extension of a Last-In-First-Out stack which has a cap to the number of stored items. Items are
removed from the bottom of the stack to kep within the size limit.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, firstElement, forEach, get, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Constructor Details
-
SizedStack
public SizedStack(int maxSize) Constructs a SizedStack.- Parameters:
maxSize
- The maximum number of items which this can hold. If less than or equal to 0, this class will behave identically to a regularStack
.
-
-
Method Details
-
push
-
equals
-
hashCode
public int hashCode()
-