org.geworkbench.bison.model.clusters
Class DefaultHierCluster

java.lang.Object
  extended by org.geworkbench.bison.model.clusters.AbstractCluster
      extended by org.geworkbench.bison.model.clusters.DefaultHierCluster
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<HierCluster>, Cluster, HierCluster
Direct Known Subclasses:
MarkerHierCluster, MicroarrayHierCluster

public class DefaultHierCluster
extends AbstractCluster
implements HierCluster, java.io.Serializable

Generalization of the Cluster contract that encapsulates functionality to handle Clusters generated from the Hierarchical Clustering analysis method

Version:
$Id: DefaultHierCluster.java 7426 2011-02-08 22:25:24Z zji $
Author:
First Genetic Trust
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.geworkbench.bison.model.clusters.AbstractCluster
children, parent
 
Constructor Summary
DefaultHierCluster()
           
 
Method Summary
 void addNode(HierCluster hc, int index)
          Adds Cluster as a child of this node
 int compareTo(HierCluster o)
          Comparable method that compares this Cluster to another Hierarchical CLuster node.
 int getDepth()
          Gets the Combinatorial Depth of this Cluster
 double getHeight()
          Gets the Algorithmic Height of this Cluster
 double getMaxHeight()
          Returns the Maximum Algorithmic Height of any Cluster in the Hierarchical Cluster Tree that this Cluster is a part of
 HierCluster getNode(int index)
          Gets a particular child from a known index
 void setDepth(int d)
          Sets the Combinatorial Depth of this Cluster
 void setHeight(double d)
          Sets the Algorithmic Height of this Cluster
 
Methods inherited from class org.geworkbench.bison.model.clusters.AbstractCluster
addNode, getChildrenNodes, getLeafChildren, getLeafChildrenCount, getLeafChildrenCountMap, getNodesCount, getParent, isLeaf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geworkbench.bison.model.clusters.Cluster
addNode, getChildrenNodes, getLeafChildren, getLeafChildrenCount, getLeafChildrenCountMap, getNodesCount, getParent, isLeaf
 

Constructor Detail

DefaultHierCluster

public DefaultHierCluster()
Method Detail

setHeight

public void setHeight(double d)
Sets the Algorithmic Height of this Cluster

Specified by:
setHeight in interface HierCluster
Parameters:
d - height of this node

getHeight

public double getHeight()
Gets the Algorithmic Height of this Cluster

Specified by:
getHeight in interface HierCluster
Returns:
height of this node

getMaxHeight

public double getMaxHeight()
Returns the Maximum Algorithmic Height of any Cluster in the Hierarchical Cluster Tree that this Cluster is a part of

Specified by:
getMaxHeight in interface HierCluster
Returns:
maximum height

getDepth

public int getDepth()
Gets the Combinatorial Depth of this Cluster

Specified by:
getDepth in interface HierCluster
Returns:
depth of this node

setDepth

public void setDepth(int d)
Sets the Combinatorial Depth of this Cluster

Specified by:
setDepth in interface HierCluster
Parameters:
d - depth of this node

addNode

public void addNode(HierCluster hc,
                    int index)
Adds Cluster as a child of this node

Specified by:
addNode in interface HierCluster
Parameters:
hc - child to be added
index - index at which the child is to be added

getNode

public HierCluster getNode(int index)
Gets a particular child from a known index

Specified by:
getNode in interface HierCluster
Parameters:
index - child with the index that has be retrievd
Returns:
the child node or null if no child with the given index exists

compareTo

public int compareTo(HierCluster o)
Comparable method that compares this Cluster to another Hierarchical CLuster node. The basis of comparison is the number of children bothe the nodes contain

Specified by:
compareTo in interface java.lang.Comparable<HierCluster>
Parameters:
o - HierCluster to be compared to
Returns:
  • 1 if o contains more children
  • -1 if this HierCluster
  • contains more children
  • 0 if both have same number of children