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, java.util.Iterator, DSIdentifiable, Cluster, HierCluster
Direct Known Subclasses:
MarkerHierCluster, MicroarrayHierCluster, SimpleHierCluster

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

Author:
First Genetic Trust
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.geworkbench.bison.model.clusters.AbstractCluster
children, clusterID, iterator, parent
 
Constructor Summary
DefaultHierCluster()
           
 
Method Summary
 void addNode(HierCluster hc, int index)
          Adds Cluster as a child of this node
 int compareTo(java.lang.Object 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
 java.lang.String toString()
           
 
Methods inherited from class org.geworkbench.bison.model.clusters.AbstractCluster
addNode, getChildrenNodes, getID, getLabel, getLeafChildren, getLeafChildrenCount, getLeafChildrenCountMap, getNodesCount, getParent, hasNext, isLeaf, next, remove, remove, removeAll, reset, setID, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geworkbench.bison.model.clusters.HierCluster
removeAll
 
Methods inherited from interface org.geworkbench.bison.model.clusters.Cluster
addNode, getChildrenNodes, getLeafChildren, getLeafChildrenCount, getLeafChildrenCountMap, getNodesCount, getParent, isLeaf
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 
Methods inherited from interface org.geworkbench.bison.datastructure.properties.DSIdentifiable
getID, setID
 

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(java.lang.Object 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
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

  • toString

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