Interface Stack<T>

  • Type Parameters:
    T - The type of things stored in the stack
    All Known Implementing Classes:
    StandardStack

    public interface Stack<T>
    Stack implementation exposing useful methods for Hibernate needs.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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
      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 visitRootFirst​(Consumer<T> action)
      Visit all elements in the stack, starting with the root and working "forward"
    • Method Detail

      • 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
      • 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
      • visitRootFirst

        void visitRootFirst​(Consumer<T> action)
        Visit all elements in the stack, starting with the root and working "forward"
      • 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