Class BreadthFirstTrace

  • All Implemented Interfaces:
    Trace

    public class BreadthFirstTrace
    extends java.lang.Object
    implements Trace
    A breadth first traversal trace.

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

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static @NotNull java.lang.String CONTEXT_SPEC
      The context specification of this trace.
    • Constructor Summary

      Constructors 
      Constructor Description
      BreadthFirstTrace​(int depth, @NotNull java.lang.String path, @NotNull java.util.function.Consumer<java.util.List<java.lang.String>> context)
      Create a new instance of a breadth first traversal trace.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run​(@NotNull NodeState node)
      Run this trace on the passed node.
      • Methods inherited from class java.lang.Object

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

      • BreadthFirstTrace

        public BreadthFirstTrace​(int depth,
                                 @NotNull
                                 @NotNull java.lang.String path,
                                 @NotNull
                                 @NotNull java.util.function.Consumer<java.util.List<java.lang.String>> context)
        Create a new instance of a breadth 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