A name for this node
Find the specified node and return the index
the node to search for
the index or null, if no node was found
Get a child based on the given name
the name of the child node
the found node or null
Get all children of this node, if any.
the children of this node. If the node doesn't contain any children, an empty array is returned
Retrieve arbitrary data from the node
the value
The distance of this node from the root node.
If it IS the root node, it's 0. If it's parent is the root node it's 1 and so on.
Get a node by specifying its path. This can be an absolute path, starting with the path separator or a relative path starting from the current node.
The path string
an optional path separator
Retrieve a node by specifying all node names in between
an array of node names forming the path
should the path be treated absolute? (if not, relative from the current node is used)
Return the parent node of this node
the parent node or null, if no parent node exists
Return an absolute path to this node starting with the pathSeparator.
The optional path separator [/]
Get all nodes in the direct path from root for this node
Get the root this node belongs to
Return, wether this node is the root node (has now parent)
true, if this node is the root node
Remove a child by specifying the node or index that should be removed.
The child node or index to be removed
Set arbitrary data to the node
A key
The value
A reference back to the node
Set the parent of this node
Return a JSON representation of the node
Walk the tree in the given direction and call the action function on each node you encounter.
The direction can also be an array of directions. In this case, the next direction will be called, if there's no node left in the first direction.
For example, specify [Direction.left, Direction.right] will walk through the children in the left direction. After the first child is encountered, the parent node is walked and so on.
Generated using TypeDoc
A node in the hierarchy