|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiggests.clustering.ClusterTreeNode
public class ClusterTreeNode
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
ClusterTreeNode
s 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 |
---|
public ClusterTreeNode()
ClusterTreeNode
with left
,
right
and distance
attributes initialized
to 0.
public ClusterTreeNode(int left, int right, double distance)
ClusterTreeNode
with left
,
right
and distance
attributes initialized
to left
, right
and distance
argument values, respectively.
left
- int
the index for the left
element/noderight
- int
the index for the right
element/nodedistance
- double
the distance between
left
and right
elements or nodespublic ClusterTreeNode(ClusterTreeNode node)
ClusterTreeNode
initializing left
, right
and
distance
attributes with values retrieved from
node
.
node
- the ClusterTreeNode
to copy the attribute
values fromMethod Detail |
---|
public int getLeft()
public int getRight()
public double getDistance()
public void setLeft(int newLeft)
newLeft
- int
the index for left sonpublic void setRight(int newRight)
newRight
- int
the index for right sonpublic void setDistance(double newDistance)
newDistance
- double
the distance between left and right sonspublic boolean equals(java.lang.Object obj)
Object
's equals
method.
Checks if this ClusterTreeNode
is equal to
obj
.
equals
in class java.lang.Object
obj
- the Object
to compare with this one
true
if this obj
are equal, false
otherwise.public java.lang.Object clone()
Object
's clone
method.
Clones this ClusterTreeNode
object.
Returns a ClusterTreeNode
object equal to this one.
clone
in class java.lang.Object
ClusterTreeNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |