com.facetmap.simple
Class TreeNode

java.lang.Object
  extended by com.facetmap.simple.TreeNode

public class TreeNode
extends java.lang.Object

Encapsulates basic tree functions, for use by backward-heading and forward-heading computation.


Field Summary
protected  java.lang.Object baseObject
           
protected  java.util.List children
           
protected  TreeNode parent
           
 
Constructor Summary
TreeNode(java.lang.Object baseObject)
           
TreeNode(java.lang.Object baseObject, TreeNode parent)
           
TreeNode(java.lang.Object baseObject, TreeNode parent, int indexWithinParent)
           
 
Method Summary
 void adopt(TreeNode child)
          Assign the specified node as a child of this node.
 void claimParent(TreeNode claimedParent)
          Make this TreeNode claim a parent TreeNode, without making the parent adopt this TreeNode as a child.
 java.lang.Object getBaseObject()
           
 int getChildCount()
           
 java.util.Iterator getForwardNodes()
           
 java.util.Iterator getForwardObjects()
           
 TreeNode getParent()
           
 java.lang.Object getParentObject()
           
 boolean hasChildren()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

baseObject

protected java.lang.Object baseObject

parent

protected TreeNode parent

children

protected java.util.List children
Constructor Detail

TreeNode

public TreeNode(java.lang.Object baseObject)

TreeNode

public TreeNode(java.lang.Object baseObject,
                TreeNode parent)

TreeNode

public TreeNode(java.lang.Object baseObject,
                TreeNode parent,
                int indexWithinParent)
Method Detail

getForwardNodes

public java.util.Iterator getForwardNodes()

getForwardObjects

public java.util.Iterator getForwardObjects()

getParent

public TreeNode getParent()

getParentObject

public java.lang.Object getParentObject()

getBaseObject

public java.lang.Object getBaseObject()

getChildCount

public int getChildCount()

hasChildren

public boolean hasChildren()

adopt

public void adopt(TreeNode child)
Assign the specified node as a child of this node. This is a bidirectional link; the specified child will have this node assigned as its parent.


claimParent

public void claimParent(TreeNode claimedParent)
Make this TreeNode claim a parent TreeNode, without making the parent adopt this TreeNode as a child. This is important for anonymous headings.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object