Package io.molr.mole.core.utils
Class Trees
- java.lang.Object
-
- io.molr.mole.core.utils.Trees
-
public class Trees extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Trees()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
doesBlockHaveAParallelParent(io.molr.commons.domain.Block block, TreeStructure structure)
Return whether or not the block has a parent in the hierarchy of the providedTreeStructure
that is parallelstatic void
logResultsOf(TreeTracker resultTracker, TreeStructure structure)
Walks through theTreeStructure
logging on screen the result of each nodestatic void
visitParentBeforeChild(TreeStructure structure, java.util.function.BiConsumer<io.molr.commons.domain.Block,java.lang.Integer> c)
Walk through the providedTreeStructure
visiting the parent before each child.
-
-
-
Method Detail
-
logResultsOf
public static void logResultsOf(TreeTracker resultTracker, TreeStructure structure)
Walks through theTreeStructure
logging on screen the result of each node
-
visitParentBeforeChild
public static void visitParentBeforeChild(TreeStructure structure, java.util.function.BiConsumer<io.molr.commons.domain.Block,java.lang.Integer> c)
Walk through the providedTreeStructure
visiting the parent before each child. TheBiConsumer
is applied to each node and the second parameter represents the current depth of the node in the tree.
-
doesBlockHaveAParallelParent
public static boolean doesBlockHaveAParallelParent(io.molr.commons.domain.Block block, TreeStructure structure)
Return whether or not the block has a parent in the hierarchy of the providedTreeStructure
that is parallel
-
-