接口 Stack<T>

  • 类型参数:
    T - The type of things stored in the stack
    所有已知实现类:
    SingletonStack, StandardStack

    public interface Stack<T>
    Stack implementation exposing useful methods for Hibernate needs.
    作者:
    Steve Ebersole
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      void clear()
      Remove all elements from the stack
      int depth()
      How many elements are currently on the stack?
      <X> X findCurrentFirst​(Function<T,​X> action)
      Find an element on the stack and return a value.
      T getCurrent()
      The element currently at the top of the stack
      T getPrevious()
      The element previously at the top of the stack before the current one
      boolean isEmpty()
      Are there no elements currently in the stack?
      T pop()
      Pop (remove and return) the current element off the stack
      void push​(T newCurrent)
      Push the new element on the top of the stack
      void visitCurrentFirst​(Consumer<T> action)
      Visit all elements in the stack, starting with the current and working back
    • 方法详细资料

      • push

        void push​(T newCurrent)
        Push the new element on the top of the stack
      • pop

        T pop()
        Pop (remove and return) the current element off the stack
      • getCurrent

        T getCurrent()
        The element currently at the top of the stack
      • getPrevious

        T getPrevious()
        The element previously at the top of the stack before the current one
      • depth

        int depth()
        How many elements are currently on the stack?
      • isEmpty

        boolean isEmpty()
        Are there no elements currently in the stack?
      • clear

        void clear()
        Remove all elements from the stack
      • visitCurrentFirst

        void visitCurrentFirst​(Consumer<T> action)
        Visit all elements in the stack, starting with the current and working back
      • findCurrentFirst

        <X> X findCurrentFirst​(Function<T,​X> action)
        Find an element on the stack and return a value. The first non-null element returned from `action` stops the iteration and is returned from here