Class Stack<T>

All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess

public class Stack<T> extends ArrayList<T>
A drop-in replacement for Stack based on ArrayList (instead of Vector) and therefore is (1) not synchronized and (2) faster.
See Also:
  • Constructor Details

    • Stack

      public Stack()
    • Stack

      public Stack(int initialCapacity)
    • Stack

      public Stack(@NotNull @NotNull Collection<? extends T> init)
    • Stack

      public Stack(@NotNull @NotNull T... items)
  • Method Details

    • push

      public void push(T t)
    • peek

      public T peek()
    • pop

      public T pop()
    • tryPop

      @Nullable public T tryPop()
    • empty

      public boolean empty()
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<T>
      Specified by:
      equals in interface List<T>
      Overrides:
      equals in class ArrayList<T>