borland Packages  Class Hierarchy  jbcl.model Package  Index 

LinkedTreeNode component

java.lang.Object
   +----borland.jbcl.model.LinkedTreeNode

About the LinkedTreeNode component

Variables  Constructors  Properties  Methods  

Implements GraphLocation, Serializable

A LinkedTreeNode object is the item container for use with LinkedTreeContainer. It contains the properties and methods needed to function as a node on a tree.

Use the firstChild property to find the first child node of this node and use nextSibling to find the next node at the same level in the tree as this node. The children property returns an array of all GraphLocations that are children of the node.


LinkedTreeNode variables

Variables implemented in this class

LinkedTreeNode constructors

LinkedTreeNode properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

LinkedTreeNode methods

Methods implemented in this class

Methods implemented in java.lang.Object


LinkedTreeNode variables

childCount

  protected int childCount
A variable that holds the number of children this node has.

firstChild

  protected LinkedTreeNode firstChild
The LinkedTreeNode object that is the immediate descendant of this node.

nextSibling

  protected LinkedTreeNode nextSibling
The LinkedTreeNode object that is the next sibling of this node in the tree hierarchy.

parent

  protected LinkedTreeNode parent
The LinkedTreeNode object that is the parent of this node.

LinkedTreeNode constructors

LinkedTreeNode()

  public LinkedTreeNode()
Constructs a LinkedTreeNode object with default property values, and with the current object as its parent.

LinkedTreeNode(borland.jbcl.model.LinkedTreeNode)

  public LinkedTreeNode(borland.jbcl.model.LinkedTreeNode parent)
Constructs a LinkedTreeNode object as a child of the node passed as the parent argument. If parent is null, the new node is the root of the tree.

Parameters:

parent
The node that is the immediate ancestor of this node in the hierarchy.

LinkedTreeNode properties

childIterator

 public ForwardIterator getChildIterator()
Returns an iterator over the children of this node.

children

 public GraphLocation[] getChildren()
Returns the children of this node.

firstChild

 public LinkedTreeNode getFirstChild()
Returns the first child of this node.

nextSibling

 public LinkedTreeNode getNextSibling()
Returns the next sibling of this node.

parent

 public GraphLocation getParent()
Returns the parent of this node.

LinkedTreeNode methods

appendChild(borland.jbcl.model.LinkedTreeNode)

  public void appendChild(borland.jbcl.model.LinkedTreeNode newChild)
Adds a node at the end of the chain of children of this node.

Parameters:

newChild
The node to append

check()

  public void check()
A method that checks the validity of the position of the node in the tree. If the node is not the parent of its designated children, an IllegalStateException is thrown. Also, if the first child node is equal to that node's next sibling, an IllegalStateException is thrown. This method is intended as a debugging aid.

doAddChild(borland.jbcl.model.LinkedTreeNode, borland.jbcl.model.LinkedTreeNode)

  protected void doAddChild(borland.jbcl.model.LinkedTreeNode newChild, borland.jbcl.model.LinkedTreeNode aheadOf)
Adds a new node to the node chain. doAddChild() is called by the appendChild() and the insertChild() methods.

Parameters:

newChild
The node to insert into the node chain.
aheadOf
The existing node to insert the node chain before. aheadOf is null if the node is being appended to the end of the node chain.

insertChild(borland.jbcl.model.LinkedTreeNode)

  public void insertChild(borland.jbcl.model.LinkedTreeNode newChild)
Adds a node chain in front of the first child of this node. The inserted node becomes the first child.

Parameters:

newChild
The new node added before the first child of this node.

insertChild(borland.jbcl.model.LinkedTreeNode, borland.jbcl.model.LinkedTreeNode)

  public void insertChild(borland.jbcl.model.LinkedTreeNode newChild, borland.jbcl.model.LinkedTreeNode aheadOf)
Inserts a node in this node's child chain. The node is added in front of the specified child of this node.

Parameters:

newChild
The node to be inserted.
aheadOf
The node the new node is inserted before.

insertSibling(borland.jbcl.model.LinkedTreeNode)

  public void insertSibling(borland.jbcl.model.LinkedTreeNode newSibling)
Inserts a node chain in front of the first sibling of this node.

Parameters:

newSibling
The node inserted before the first sibling of this node.

print()

  public void print()
Prints the node chain beginning at the root. This method is intended as a debugging aid.

print(int)

  public void print(int level)
Prints all nodes at the specified level and all their children. This method is intended as a debugging aid.

removeChild(borland.jbcl.model.LinkedTreeNode)

  public void removeChild(borland.jbcl.model.LinkedTreeNode unwantedChild)
Removes a single child from this node's chain of children.

Parameters:

unwantedChild
The node to remove from the child node chain.

removeNode(borland.jbcl.model.LinkedTreeNode)

  public LinkedTreeNode removeNode(borland.jbcl.model.LinkedTreeNode root)
Removes this node from its tree, returning the root node. The root node is passed to this method as removing this node from the tree might require an adjustment to the root node. So the root node returned might differ from the one passed to the method.

Parameters:

root
The root node of this node chain.

setParent(borland.jbcl.model.LinkedTreeNode)

  protected void setParent(borland.jbcl.model.LinkedTreeNode parent)
Sets this node's parent node.

Parameters:

parent
The node this child becomes a child of.