Class Composite.VisitorSupport<T,​R>

    • Constructor Summary

      Constructors 
      Constructor Description
      VisitorSupport()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      R getValue()
      Returns the value of this visitor.
      void postVisit​(T object)
      Visits an object.
      void preVisit​(T object)
      Visits an object.
      void visit​(T object)
      Visits an object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VisitorSupport

        public VisitorSupport()
    • Method Detail

      • preVisit

        public void preVisit​(@Nonnull
                             T object)
        Visits an object. This method is called before visiting children (pre-order).
        Specified by:
        preVisit in interface Composite.Visitor<T,​R>
        Parameters:
        object - the visited object
      • visit

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

        public void postVisit​(@Nonnull
                              T object)
        Visits an object. This method is called after visiting children (post-order).
        Specified by:
        postVisit in interface Composite.Visitor<T,​R>
        Parameters:
        object - the visited object