public static interface Tree.Builder<T extends Node>
Modifier and Type | Method and Description |
---|---|
Tree.Builder<T> |
addNode(Node node)
Adds
node to this Builder instance. |
T |
build()
Returns a new (possibly immutable)
Tree instance. |
Tree.Builder<T> |
removeNode(Node node)
Removes
node from this Builder instance. |
Tree.Builder<T> addNode(Node node)
node
to this Builder
instance.
Returns the Builder
instance itself.
If node
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
node
- the Node
to addBuilder
instance itselfjava.lang.NullPointerException
- thrown if, and only if, node
is null
Tree.Builder<T> removeNode(Node node)
node
from this Builder
instance.
Returns the Builder
instance itself.
If node
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
node
- the Node
to removeBuilder
instance itselfjava.lang.NullPointerException
- thrown if, and only if, node
is null