TreeNode
Constructors
Functions
Link copied to clipboard
fun allChildren(enterCondition: (TreeNode<T>) -> Boolean = { true }, yieldCondition: (TreeNode<T>) -> Boolean = { true }): List<TreeNode<T>>
Traverses the tree in depth-first order and returns all nodes that satisfy yieldCondition. If enterCondition returns false for a node, its children are not traversed. By default, all nodes are traversed and all nodes are returned.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal fun <T> TreeNode<T>.topmostChildren(yieldCondition: (TreeNode<T>) -> Boolean): List<TreeNode<T>>
Traverses all children in the tree in depth-first order and returns the top-most nodes that satisfy yieldCondition. This means that if a node satisfies yieldCondition, its children are not traversed, regardless of whether they satisfy yieldCondition or not.
Link copied to clipboard
Link copied to clipboard