Class TreeNode

java.lang.Object
   |
   +----Node
           |
           +----TreeNode

class TreeNode
extends Node
A generic hierarchical tree node.

Version:
1.00
Author:
Bill Lorton

Constructor Index

 o TreeNode()
The TreeNode constructor.

Method Index

 o 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.
 o child()
Gets the first child of this node.
 o parent()
Gets the parent of this node.
 o setParent(TreeNode)
Sets the parent of this node.

Constructors

 o TreeNode
 public TreeNode()
The TreeNode constructor.

Methods

 o setParent
 public void setParent(TreeNode n)
Sets the parent of this node.

Parameters:
n - the node to set as the parent
 o 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
 o parent
 public TreeNode parent()
Gets the parent of this node.

Returns:
the parent of this node
 o child
 public TreeNode child()
Gets the first child of this node.

Returns:
the first child of this node