Class SizedStack<T>

Type Parameters:
T - Data type contained by the stack.
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess

public class SizedStack<T> extends Stack<T>
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 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 regular Stack.
  • Method Details