Constructor and Description |
---|
TreeNodeImpl(TreeNode<T> parent,
T object,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TreeNode<T> |
addChild(TreeNode<T> child)
Add the specified child node.
|
TreeNode<T> |
addChild(T child,
String name)
Add a child node for the provided object.
|
TreeNode<T> |
getChild(String name)
Find a child node by name.
|
Collection<TreeNode<T>> |
getChildren()
Obtain the list of child nodes.
|
String |
getName()
Obtain the name of the node.
|
T |
getObject()
Obtain the object associated with this node.
|
TreeNode<T> |
getParent()
Obtain the parent node or null if this node is the root.
|
String |
getProperty(String name)
Get the specified node property.
|
void |
removeProperty(String name)
Remove a property from the node.
|
void |
setName(String name)
Set the name of the node.
|
void |
setParent(TreeNode<T> parent)
Set the parent node.
|
void |
setProperty(String name,
String value)
Set a property on the node.
|
public TreeNode<T> getParent()
TreeNode
public Collection<TreeNode<T>> getChildren()
TreeNode
getChildren
in interface TreeNode<T>
public T getObject()
TreeNode
public void setName(String name)
TreeNode
public String getName()
TreeNode
public void setParent(TreeNode<T> parent)
TreeNode
public TreeNode<T> addChild(T child, String name)
TreeNode
public TreeNode<T> addChild(TreeNode<T> child)
TreeNode
public void setProperty(String name, String value)
TreeNode
setProperty
in interface TreeNode<T>
name
- the name of the propertyvalue
- the value of the propertypublic String getProperty(String name)
TreeNode
getProperty
in interface TreeNode<T>
name
- property namepublic void removeProperty(String name)
TreeNode
removeProperty
in interface TreeNode<T>
name
- name of property to be removedCopyright © 2015. All rights reserved.