Class Trees


  • public class Trees
    extends Object
    • Constructor Detail

      • Trees

        public Trees()
    • Method Detail

      • logResultsOf

        public static void logResultsOf​(TreeTracker<?> tracker,
                                        TreeStructure structure)
        Walks through the TreeStructure, writing the result of each node to the logger.
        Parameters:
        tracker - the tracker whose results to write to the logger
        structure - the structure to walk through
      • visitParentBeforeChild

        public static void visitParentBeforeChild​(TreeStructure structure,
                                                  BiConsumer<Block,​Integer> c)
        Walk through the provided TreeStructure visiting the parent before each child. The BiConsumer is applied to each node and the second parameter represents the current depth of the node in the tree.
        Parameters:
        structure - the structure to walk through
        c - a biconsumer which is called for each block, with the block as first parameter and the depth in the tree as second.
      • doesBlockHaveAParallelParent

        public static boolean doesBlockHaveAParallelParent​(Block block,
                                                           TreeStructure structure)
        Return whether or not the block has a parent in the hierarchy of the provided TreeStructure that is parallel
        Parameters:
        block - the block for which to query if it has a parent which is parallel
        structure - the tree structure to consider
        Returns:
        true if the block has a parent which is parallel, false if not.