Class DFTreeVisitor<T>

  • Type Parameters:
    T - type of tree node payload.
    All Implemented Interfaces:
    ITreeVisitor<T>

    public abstract class DFTreeVisitor<T>
    extends java.lang.Object
    implements ITreeVisitor<T>
    Depth first visitor.

    Note that this visitor should not be used for large trees, as the stack depth required can become quite large.

    See Also:
    DFIterator
    • Constructor Summary

      Constructors 
      Constructor Description
      DFTreeVisitor()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void processPayload​(T value, int level)
      Override in subclasses to act on the values in depth first order.
      void visit​(ITreeNode<T> node)  
      • Methods inherited from class java.lang.Object

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

      • DFTreeVisitor

        public DFTreeVisitor()
    • Method Detail

      • processPayload

        protected abstract void processPayload​(T value,
                                               int level)
        Override in subclasses to act on the values in depth first order.
        Parameters:
        value - the payload.
        level - the tree level.