| Constructor and Description |
|---|
DefaultNode()
Constructor that initializes a node which contains the empty string as its node text.
|
DefaultNode(String pText)
Constructor.
|
DefaultNode(String pText,
String pKey,
NodeColor pColorOverride,
String pAnnotation,
List<Node> pChildren) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Node pChild) |
String |
getAnnotation()
Return a String here to display as a node annotation.
|
Iterable<Node> |
getChildren()
The node's child nodes.
|
NodeColor |
getColor()
Return a color here for colored nodes.
|
String |
getKey()
An optional primary key for the node.
|
String |
getText()
The node's text.
|
void |
setAnnotation(String pAnnotation) |
void |
setChildren(List<Node> pChildren) |
void |
setColor(NodeColor pColorOverride) |
void |
setKey(String pKey) |
void |
setText(String pText) |
public DefaultNode()
public DefaultNode(String pText)
pText - the node's text@CheckForNull public String getAnnotation()
NodegetAnnotation in interface Nodenull for no annotation@Nonnull public Iterable<Node> getChildren()
Nodenull (shouldn't, but we
can handle it).getChildren in interface Nodenull / empty if this is a leaf node@CheckForNull public NodeColor getColor()
NodegetColor in interface Nodenull to use the color from the tree's color scheme. A value of
NodeColor.None indicates that the node must not be colored.@CheckForNull public String getKey()
NodeIdentityScheme.ByKey is explicitly selected. Otherwise, this method should be left to its default
implementation.
If you actually use this value (because you've chosen IdentityScheme.ByKey), then you should make
sure that it not return null. All nodes which do that will be considered the same node then
(which may be what you want. I'm just saying).
@CheckForNull public String getText()
Node