LiLaC API
1.0.0-beta.3-api
jvm
LiLaC API
/
opekope2.lilac.util
/
Tree
/
Node
Node
class
Node
(
source
)
Represents a node of a tree.
Members
Constructors
Node
Link copied to clipboard
constructor
(
@
NotNull
text
:
@
NotNull
String
,
@
Nullable
parent
:
@
Nullable
Tree.Node
)
Creates a new node with its
associated text
and an optional parent.
constructor
(
@
NotNull
text
:
@
NotNull
String
)
Creates a new node with its
associated text
without a parent.
Properties
children
Link copied to clipboard
@
NotNull
val
children
:
@
NotNull
List
<
Tree.Node
>
A read-only list of the node's children.
text
Link copied to clipboard
@
NotNull
val
text
:
@
NotNull
String
The text associated with the node.
Functions
append
Child
Link copied to clipboard
@
NotNull
open
fun
appendChild
(
@
NotNull
text
:
@
NotNull
String
)
:
@
NotNull
Tree.Node
Creates a new node and adds it as a new child of the current node.
to
String
Link copied to clipboard
open
fun
toString
(
)
:
String