public class TreeNode
extends java.lang.Object
implements java.io.Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
TreeNode()
Create a new TreeNode with no parent.
|
protected |
TreeNode(TreeNode parent)
Create a new TreeNode with parent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(TreeNode newChild)
Add a child to this node.
|
java.util.ArrayList |
getChildren()
The children of this node.
|
TreeNode |
getParent()
The parent node of this one; null if this is the root node.
|
void |
remove()
Removes current node from tree; children are assigned to parent.
|
void |
removeChild(TreeNode victim)
Remove a child.
|
void |
reparent(TreeNode newParent)
ArrayList the parent node of this node.
|
void |
setChildren(java.util.ArrayList newChildren)
The children of this node.
|
protected TreeNode(TreeNode parent)
protected TreeNode()
public TreeNode getParent()
public void reparent(TreeNode newParent)
public java.util.ArrayList getChildren()
public void setChildren(java.util.ArrayList newChildren)
public void addChild(TreeNode newChild)
public void removeChild(TreeNode victim)
public void remove()