Cytoscape 2.5.1 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.dialogs.plugins
Class TreeNode

java.lang.Object
  extended by cytoscape.dialogs.plugins.TreeNode

public class TreeNode
extends Object


Constructor Summary
TreeNode(PluginInfo obj)
          Creates a TreeNode with given PluginInfo object, no parent and does not allow children.
TreeNode(PluginInfo obj, boolean allowsChildren)
          Creates a TreeNode with given PluginInfo object, no parent and allows children if specified.
TreeNode(String Title)
          Creates a TreeNode with given title, no parent and allows children.
TreeNode(String Title, boolean allowsChildren)
          Creates a TreeNode with given title, no parent and allows children if specified.
 
Method Summary
 void addChild(TreeNode newChild)
          Adds newChild to this node if children are allowed.
 void addChildren(TreeNode[] children)
          Adds all children to the child list of this node if children are allowed.
 void addObject(PluginInfo info)
          Adds a PluginInfo object to this node.
 TreeNode getChildAt(int index)
          Get child from this node's child list at given index.
 int getChildCount()
          Get total number of children for this node
 Vector<TreeNode> getChildren()
          Gets the list of children for this node
 int getIndexOfChild(TreeNode child)
          Gets the index of child from this node's child list.
 int getLeafCount()
          Gets the total (recursively) of all leaves under this node.
 PluginInfo getObject()
          Gets the PluginInfo object of this node.
 TreeNode getParent()
          Gets the parent of this node
 String getTitle()
          Gets the title of this node.
 int getTreeCount()
          Gets the total (recursively) of all child nodes that are not leaves.
 boolean isLeaf()
          Returns true if this node has no children or does not allow them.
 boolean isNodeAncestor(TreeNode otherNode)
          Returns true if otherNode is an ancestor of this node.
 void removeChild(TreeNode child)
          Removes child from this node.
 void removeChildren()
          Clears the list of children for this node.
 void setParent(TreeNode newParent)
          Sets this nodes parent to newParent, child list does not change.
 String toString()
          Gets string representation of this node as 'title: total leaves'
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(String Title)
Creates a TreeNode with given title, no parent and allows children.

Parameters:
Title -

TreeNode

public TreeNode(String Title,
                boolean allowsChildren)
Creates a TreeNode with given title, no parent and allows children if specified.

Parameters:
Title -
allowsChildren -

TreeNode

public TreeNode(PluginInfo obj)
Creates a TreeNode with given PluginInfo object, no parent and does not allow children.

Parameters:
obj -

TreeNode

public TreeNode(PluginInfo obj,
                boolean allowsChildren)
Creates a TreeNode with given PluginInfo object, no parent and allows children if specified.

Parameters:
obj -
allowsChildren -
Method Detail

isLeaf

public boolean isLeaf()
Returns true if this node has no children or does not allow them.

Returns:

isNodeAncestor

public boolean isNodeAncestor(TreeNode otherNode)
Returns true if otherNode is an ancestor of this node.

Parameters:
otherNode -
Returns:

setParent

public void setParent(TreeNode newParent)
Sets this nodes parent to newParent, child list does not change.

Parameters:
newParent -

getParent

public TreeNode getParent()
Gets the parent of this node

Returns:
TreeNode

addObject

public void addObject(PluginInfo info)
Adds a PluginInfo object to this node.

Parameters:
info -

addChild

public void addChild(TreeNode newChild)
Adds newChild to this node if children are allowed.

Parameters:
newChild -

removeChild

public void removeChild(TreeNode child)
Removes child from this node.

Parameters:
child -

removeChildren

public void removeChildren()
Clears the list of children for this node.


addChildren

public void addChildren(TreeNode[] children)
Adds all children to the child list of this node if children are allowed.

Parameters:
children -

getChildren

public Vector<TreeNode> getChildren()
Gets the list of children for this node

Returns:
Vector

getChildCount

public int getChildCount()
Get total number of children for this node

Returns:
int

getChildAt

public TreeNode getChildAt(int index)
Get child from this node's child list at given index.

Parameters:
index -
Returns:
TreeNode

getIndexOfChild

public int getIndexOfChild(TreeNode child)
Gets the index of child from this node's child list.

Parameters:
child -
Returns:
int

getTreeCount

public int getTreeCount()
Gets the total (recursively) of all child nodes that are not leaves.

Returns:
int

getLeafCount

public int getLeafCount()
Gets the total (recursively) of all leaves under this node.

Returns:

getTitle

public String getTitle()
Gets the title of this node.

Returns:
String

getObject

public PluginInfo getObject()
Gets the PluginInfo object of this node.

Returns:
PluginInfo

toString

public String toString()
Gets string representation of this node as 'title: total leaves'

Overrides:
toString in class Object

www.cytoscape.org