Class BFTreeVisitor<T>

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

    public abstract class BFTreeVisitor<T>
    extends Object
    implements ITreeVisitor<T>
    Breadth first visitor class.

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

    See Also:
    BFIterator
    • Constructor Detail

      • BFTreeVisitor

        public BFTreeVisitor()
    • Method Detail

      • processPayload

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