Interface LongStack

All Superinterfaces:
Stack<Long>
All Known Implementing Classes:
AbstractLongBigList, AbstractLongBigList.LongRandomAccessSubList, AbstractLongBigList.LongSubList, AbstractLongList, AbstractLongList.LongRandomAccessSubList, AbstractLongList.LongSubList, AbstractLongStack, LongArrayList, LongBigArrayBigList, LongBigLists.ListBigList, LongBigLists.Singleton, LongImmutableList, LongLists.Singleton, LongMappedBigList

public interface LongStack extends Stack<Long>
A type-specific Stack; provides some additional methods that use polymorphism to avoid (un)boxing.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Long
    peek(int i)
    Deprecated.
    Please use the corresponding type-specific method instead.
    long
    peekLong(int i)
    Peeks at an element on the stack (optional operation).
    default Long
    pop()
    Deprecated.
    Please use the corresponding type-specific method instead.
    long
    Pops the top off the stack.
    void
    push(long k)
    Pushes the given object on the stack.
    default void
    Deprecated.
    Please use the corresponding type-specific method instead.
    default Long
    top()
    Deprecated.
    Please use the corresponding type-specific method instead.
    long
    Peeks at the top of the stack (optional operation).

    Methods inherited from interface it.unimi.dsi.fastutil.Stack

    isEmpty
  • Method Details

    • push

      void push(long k)
      Pushes the given object on the stack.
      Parameters:
      k - the object to push on the stack.
      See Also:
    • popLong

      long popLong()
      Pops the top off the stack.
      Returns:
      the top of the stack.
      See Also:
    • topLong

      long topLong()
      Peeks at the top of the stack (optional operation).
      Returns:
      the top of the stack.
      See Also:
    • peekLong

      long peekLong(int i)
      Peeks at an element on the stack (optional operation).
      Parameters:
      i - an index from the stop of the stack (0 represents the top).
      Returns:
      the i-th element on the stack.
      See Also:
    • push

      @Deprecated default void push(Long o)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Pushes the given object on the stack.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      push in interface Stack<Long>
      Parameters:
      o - the object that will become the new top of the stack.
    • pop

      @Deprecated default Long pop()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Pops the top off the stack.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      pop in interface Stack<Long>
      Returns:
      the top of the stack.
    • top

      @Deprecated default Long top()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Peeks at the top of the stack (optional operation).

      This default implementation returns peek(0).

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      top in interface Stack<Long>
      Returns:
      the top of the stack.
    • peek

      @Deprecated default Long peek(int i)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Peeks at an element on the stack (optional operation).

      This default implementation just throws an UnsupportedOperationException.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      peek in interface Stack<Long>
      Parameters:
      i - an index from the stop of the stack (0 represents the top).
      Returns:
      the i-th element on the stack.