Class TreeNode
java.lang.Object
|
+----Node
|
+----TreeNode
- class TreeNode
- extends Node
A generic hierarchical tree node.
- Version:
- 1.00
- Author:
- Bill Lorton
-
TreeNode()
-
The TreeNode constructor.
-
addChild(TreeNode)
-
Adds a node to then end of this node's child list and updates the child's
parent node to be this node.
-
child()
-
Gets the first child of this node.
-
parent()
-
Gets the parent of this node.
-
setParent(TreeNode)
-
Sets the parent of this node.
TreeNode
public TreeNode()
- The TreeNode constructor.
setParent
public void setParent(TreeNode n)
- Sets the parent of this node.
- Parameters:
- n - the node to set as the parent
addChild
public void addChild(TreeNode n)
- Adds a node to then end of this node's child list and updates the child's
parent node to be this node.
- Parameters:
- n - the node to add as a child
parent
public TreeNode parent()
- Gets the parent of this node.
- Returns:
- the parent of this node
child
public TreeNode child()
- Gets the first child of this node.
- Returns:
- the first child of this node