Class DepthFirstTrace

  • All Implemented Interfaces:
    Trace

    public class DepthFirstTrace
    extends Object
    implements Trace
    A depth first traversal trace.

    When run this trace performs a depth first traversal starting from the passed node down to a certain depth. It logs the current depth, the number of traversed nodes and the current path as additional context.

    • Constructor Detail

      • DepthFirstTrace

        public DepthFirstTrace​(int depth,
                               @NotNull
                               @NotNull String path,
                               @NotNull
                               @NotNull Consumer<List<String>> context)
        Create a new instance of a depth first traversal trace.
        Parameters:
        depth - maximal depth of the nodes to traverse
        path - path of the root node where to start traversing
        context - consumer to pass the additional context to
    • Method Detail

      • run

        public void run​(@NotNull
                        @NotNull NodeState node)
        Description copied from interface: Trace
        Run this trace on the passed node.
        Specified by:
        run in interface Trace