Package-level declarations

Types

Link copied to clipboard
typealias IntPath = List<Int>
Link copied to clipboard
data class Path

An immutable representation of a path, supporting convenient concatenation

Link copied to clipboard
class Tree<T>

Set T to the type of attributes that you want to attach to a node For example: TreeNode has its attributes in List

Link copied to clipboard
data class TreeNode<T>(var name: String = "", var attributes: List<T> = listOf())

Functions

Link copied to clipboard

Get all children nodes below the passed node, including this node.

Link copied to clipboard

Get all leaves (nodes that have no children) from below this node.

Link copied to clipboard
fun <T> TreeNode<T>.getStringPath(vararg path: Int): String

Get String representation of a path from this node.

fun <T> Tree<T>.getStringPath(vararg path: Int): String

Get String representation of a path from the tree root.

Link copied to clipboard

Get a String representation of the path from the tree root to this node.

Link copied to clipboard

Prints out all leaves, each shifted by 20 * depth

Link copied to clipboard

Print all nodes in a node list, each node shifted by 20 * depth

Link copied to clipboard

Get a visualization of the whole tree.