Interface Composite.Visitor<T,​R>

  • Enclosing interface:
    Composite<T,​F extends Finder<? extends T>>

    public static interface Composite.Visitor<T,​R>
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default java.util.Optional<R> getValue()
      Returns the value of this visitor.
      default void postVisit​(T object)
      Visits an object.
      default void preVisit​(T object)
      Visits an object.
      default void visit​(T object)
      Visits an object.
    • Method Detail

      • preVisit

        default void preVisit​(@Nonnull
                              T object)
        Visits an object. This method is called before visiting children (pre-order).
        Parameters:
        object - the visited object
      • visit

        default void visit​(@Nonnull
                           T object)
        Visits an object. This method is actually called just after preVisit(Object), it makes sense to implement it when you don't need to distinguish between pre-order and post-order traversal.
        Parameters:
        object - the visited object
      • postVisit

        default void postVisit​(@Nonnull
                               T object)
        Visits an object. This method is called after visiting children (post-order).
        Parameters:
        object - the visited object
      • getValue

        @Nonnull
        default java.util.Optional<R> getValue()
        Returns the value of this visitor.
        Returns:
        the value