org.jcon.data
Class TreeNode

java.lang.Object
  extended by org.jcon.data.TreeNode
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GUITreeNode

public class TreeNode
extends java.lang.Object
implements java.io.Serializable

This is a node of a homogenous tree data structure.

See Also:
Serialized Form

Constructor Summary
protected TreeNode()
          Create a new TreeNode with no parent.
protected TreeNode(TreeNode parent)
          Create a new TreeNode with parent.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeNode

protected TreeNode(TreeNode parent)
Create a new TreeNode with parent.


TreeNode

protected TreeNode()
Create a new TreeNode with no parent.

Method Detail

getParent

public TreeNode getParent()
The parent node of this one; null if this is the root node.


reparent

public void reparent(TreeNode newParent)
ArrayList the parent node of this node. We don't call it "setParent" because we want it to be a read-only bean property (so it e.g. doesn't try to serialize it when TOFing).


getChildren

public java.util.ArrayList getChildren()
The children of this node.


setChildren

public void setChildren(java.util.ArrayList newChildren)
The children of this node.


addChild

public void addChild(TreeNode newChild)
Add a child to this node.


removeChild

public void removeChild(TreeNode victim)
Remove a child.


remove

public void remove()
Removes current node from tree; children are assigned to parent.