Interface Stack<T>

All Superinterfaces:
Feed<T>, Iterable<T>
All Known Subinterfaces:
Deque<T>

public interface Stack<T> extends Feed<T>
Last-in-first-out element feed.
Since:
2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Stack<T>
    Returns new stack that is initially empty.
    void
    push(T item)
    Pushes item to the top of the stack.

    Methods inherited from interface me.sbasalaev.staque.Feed

    clear, isEmpty, iterator, nonEmpty, peek, take

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • empty

      static <T> Stack<T> empty()
      Returns new stack that is initially empty.
    • push

      void push(T item)
      Pushes item to the top of the stack.