public abstract static class AbstractTree.AbstractBuilder<T extends Node> extends java.lang.Object implements Tree.Builder<T>
Builder
implementation that implements most methods, so you don't have to do it yourself.
It uses the design pattern Builder.
Modifier | Constructor and Description |
---|---|
protected |
AbstractBuilder()
Constructs a new
AbstractBuilder instance. |
Modifier and Type | Method and Description |
---|---|
AbstractTree.AbstractBuilder<T> |
addNode(Node node)
Adds
node to this AbstractBuilder instance. |
AbstractTree.AbstractBuilder<T> |
removeNode(Node node)
Removes
node from this AbstractBuilder instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build
protected AbstractBuilder()
AbstractBuilder
instance.public final AbstractTree.AbstractBuilder<T> addNode(Node node)
node
to this AbstractBuilder
instance.
Returns the AbstractBuilder
instance itself.
If node
is null
, a NullPointerException
will be thrown.
addNode
in interface Tree.Builder<T extends Node>
node
- the Node
to addAbstractBuilder
instance itselfjava.lang.NullPointerException
- thrown if, and only if, node
is null
public final AbstractTree.AbstractBuilder<T> removeNode(Node node)
node
from this AbstractBuilder
instance.
Returns the AbstractBuilder
instance itself.
If node
is null
, a NullPointerException
will be thrown.
removeNode
in interface Tree.Builder<T extends Node>
node
- the Node
to removeAbstractBuilder
instance itselfjava.lang.NullPointerException
- thrown if, and only if, node
is null