/** Creates a {@code Stream} that starts at {@code node} and iterates deeper into the tree in a depth-first order. */ public static <T> Stream<T> depthFirst(TreeDef<T> treeDef, T node) { return StreamSupport.stream(TreeIterable.depthFirst(treeDef, node).spliterator(), false); } }
/** Creates a {@code Stream} that starts at {@code node} and iterates deeper into the tree in a bread-first order. */ public static <T> Stream<T> breadthFirst(TreeDef<T> treeDef, T node) { return StreamSupport.stream(TreeIterable.breadthFirst(treeDef, node).spliterator(), false); }
/** Creates a {@code Stream} that starts at {@code node} and ends at its root parent. */ public static <T> Stream<T> toParent(TreeDef.Parented<T> treeDef, T node) { return StreamSupport.stream(TreeIterable.toParent(treeDef, node).spliterator(), false); }
/** Calls the given consumer on the given composite and all of its children, recursively. */ public static void forEachDeep(Composite root, Consumer<Control> ctlSetter) { TreeIterable.depthFirst(treeDefControl(), root).forEach(ctlSetter); }