Class TreeNode<E>
java.lang.Object
org.neo4j.cypherdsl.core.TreeNode<E>
- Type Parameters:
E- the type of each node value
A mutable tree structure providing
Breadth-first search
(aka in-level order traversal) and pre-ordered
depth-first search. This
class is thread-safe.
- Since:
- 2023.2.0
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionReturns a breadth-first iterator of this node and it's children.Creates a tree from aStatement.Returns an immutable collection of this nodes children.intgetLevel()Returns the level or the height in this tree in which0is the level of the root node.Returns the parent of this node ornullif this is a root node.getValue()Returns the value of this node.booleanisRoot()Returnstrueif this is the root node.preOrder()Returns a depth-first, pre-ordered iterator of this node and it's children.voidCreates an ASCII representation of this node and its children.
-
Method Details
-
from
-
isRoot
public boolean isRoot()Returnstrueif this is the root node.- Returns:
trueif this is the root node
-
getLevel
public int getLevel()Returns the level or the height in this tree in which0is the level of the root node.- Returns:
- the level or the height in this tree
-
getParent
-
getChildren
Returns an immutable collection of this nodes children.- Returns:
- an immutable collection of this nodes children
-
getValue
-
breadthFirst
-
preOrder
-
printTo
-