biggests.clustering
Class ClusterTreeNode

java.lang.Object
  extended by biggests.clustering.ClusterTreeNode

public class ClusterTreeNode
extends java.lang.Object

Title: Hierarchical Cluster Tree Node

Description: ClusterTreeNode's class describes a single node in a tree created by hierarchical clustering. The tree can be represented by an array of n ClusterTreeNodes objects, where n is the number of clustered elements minus one. The integers left and right refer to the two elements or subnodes that are joined in this node. The original elements are numbered 0..nelements-1, and the nodes -1..-(nelements-1). Distance contains the distance between the two subnodes that were joined.
This class implements Node struct defined in the C source code of Cluster 3.0 (version 1.36) by Michiel de Hoon, while at the Laboratory of DNA Information Analysis, Human Genome Center, Institute of Medical Science, University of Tokyo, Japan. The original definition was not changed, so as to maintain some direct correspondence between the two concepts (this class and the original Node struct).
Cluster 3.0 is an enhanced version of Cluster, which was originally developed by Michael Eisen while at Stanford University.

Copyright: Copyright (C) 2007 Joana Gonçalves This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. GNU General Public License also complies with the terms of Cluster/TreeView original license


Constructor Summary
ClusterTreeNode()
          Creates a new ClusterTreeNode with left, right and distance attributes initialized to 0.
ClusterTreeNode(ClusterTreeNode node)
          Copy constructor.
ClusterTreeNode(int left, int right, double distance)
          Creates a new ClusterTreeNode with left, right and distance attributes initialized to left, right and distance argument values, respectively.
 
Method Summary
 java.lang.Object clone()
          Overrides Object's clone method.
 boolean equals(java.lang.Object obj)
          Overrides Object's equals method.
 double getDistance()
          Returns the distance between the left and the right elements/nodes (the sons of this node).
 int getLeft()
          Returns the index of the left element or node (left son).
 int getRight()
          Returns the index of the right element or node (right son).
 void setDistance(double newDistance)
          Sets the distance between left and right sons.
 void setLeft(int newLeft)
          Sets the index for left son.
 void setRight(int newRight)
          Sets the index for right son.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterTreeNode

public ClusterTreeNode()
Creates a new ClusterTreeNode with left, right and distance attributes initialized to 0.


ClusterTreeNode

public ClusterTreeNode(int left,
                       int right,
                       double distance)
Creates a new ClusterTreeNode with left, right and distance attributes initialized to left, right and distance argument values, respectively.

Parameters:
left - int the index for the left element/node
right - int the index for the right element/node
distance - double the distance between left and right elements or nodes

ClusterTreeNode

public ClusterTreeNode(ClusterTreeNode node)
Copy constructor. Creates a new ClusterTreeNode initializing left, right and distance attributes with values retrieved from node.

Parameters:
node - the ClusterTreeNode to copy the attribute values from
Method Detail

getLeft

public int getLeft()
Returns the index of the left element or node (left son).

Returns:
int the index of the right element/node

getRight

public int getRight()
Returns the index of the right element or node (right son).

Returns:
int the index of the right element/node

getDistance

public double getDistance()
Returns the distance between the left and the right elements/nodes (the sons of this node).

Returns:
double the distance between the left and right sons

setLeft

public void setLeft(int newLeft)
Sets the index for left son.

Parameters:
newLeft - int the index for left son

setRight

public void setRight(int newRight)
Sets the index for right son.

Parameters:
newRight - int the index for right son

setDistance

public void setDistance(double newDistance)
Sets the distance between left and right sons.

Parameters:
newDistance - double the distance between left and right sons

equals

public boolean equals(java.lang.Object obj)
Overrides Object's equals method. Checks if this ClusterTreeNode is equal to obj.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Object to compare with this one
Returns:
boolean true if this and obj are equal, false otherwise.

clone

public java.lang.Object clone()
Overrides Object's clone method. Clones this ClusterTreeNode object. Returns a ClusterTreeNode object equal to this one.

Overrides:
clone in class java.lang.Object
Returns:
Object the clone of this ClusterTreeNode