edu.umd.cs.fuzzyTree
Class DisplayNode

java.lang.Object
  |
  +--edu.umd.cs.fuzzyTree.DisplayNode

public class DisplayNode
extends java.lang.Object

Encapsulates a node displayed by a FuzzyTree


Field Summary
 java.util.ArrayList children
          A list of DisplayNodes that are the children of this node in the display tree.
 DataNode dataNode
          The DataNode that is being displayed.
 int numMissingChildren
          The number of nodes that are the child of the current node, but are not its child in the display tree.
 DisplayNode parent
          The DisplayNode that is this node's parent
 
Constructor Summary
DisplayNode(DataNode node)
          Creates a DisplayNode that references node
 
Method Summary
 void addUnderParent(DisplayNode p)
          Adds this node under parent p, in the correct position (based on preorder index).
 boolean isOrphan()
          Returns true if this node's actual parent is not its display parent.
 void removeFromParent()
          Removes this node from its parent's children list and sets the parent reference to null.
 java.lang.String toString()
          Returns a string representation of this node, which can then be displayed in the FuzzyTree.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

dataNode

public DataNode dataNode
The DataNode that is being displayed. Is never null.

children

public java.util.ArrayList children
A list of DisplayNodes that are the children of this node in the display tree. This may not be the node's actual children.
See Also:
isOrphan()

parent

public DisplayNode parent
The DisplayNode that is this node's parent

numMissingChildren

public int numMissingChildren
The number of nodes that are the child of the current node, but are not its child in the display tree.
See Also:
isOrphan(), children
Constructor Detail

DisplayNode

public DisplayNode(DataNode node)
Creates a DisplayNode that references node
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this node, which can then be displayed in the FuzzyTree. If not debugging, only the node's label and data are included; otherwise, its preorderIndex and score may also be included.
Overrides:
toString in class java.lang.Object

addUnderParent

public void addUnderParent(DisplayNode p)
Adds this node under parent p, in the correct position (based on preorder index). Node is removed from the children list of its previous parent, if it had one.
Parameters:
p - new display node parent for this node; must be non-null

removeFromParent

public void removeFromParent()
Removes this node from its parent's children list and sets the parent reference to null.

isOrphan

public boolean isOrphan()
Returns true if this node's actual parent is not its display parent.
See Also:
FuzzyTreeModel.isOrphan(java.lang.Object)


Web Accessibility