at.tuwien.ifs.somtoolbox.visualization.clustering
Class NodeDistance

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.visualization.clustering.NodeDistance
All Implemented Interfaces:
Comparable<NodeDistance>

 class NodeDistance
extends Object
implements Comparable<NodeDistance>

Used to store a distance between two clusters. The order of the Objects is by ascending distances. If two distances are equal, the Object with the lower hash code comes first.

Version:
$Id: NodeDistance.java 3883 2010-11-02 17:13:23Z frank $
Author:
Angela Roiger

Field Summary
(package private)  double dist
           
(package private)  ClusterNode n1
           
(package private)  ClusterNode n2
           
 
Constructor Summary
NodeDistance(ClusterNode no1, ClusterNode no2, double d)
           
 
Method Summary
 int compareTo(NodeDistance o)
           
 boolean equals(Object o)
          Compare this Node distance to another Object.
 int hashCode()
          Must be equal if the objects are equal according to nodeDistance.equal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

n1

ClusterNode n1

n2

ClusterNode n2

dist

double dist
Constructor Detail

NodeDistance

public NodeDistance(ClusterNode no1,
                    ClusterNode no2,
                    double d)
Method Detail

equals

public boolean equals(Object o)
Compare this Node distance to another Object. Two distances are equal if all their components (nodes & distance value) are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
Must be equal if the objects are equal according to nodeDistance.equal. Should not be equal otherwise.

Overrides:
hashCode in class Object

compareTo

public int compareTo(NodeDistance o)
              throws ClassCastException
Specified by:
compareTo in interface Comparable<NodeDistance>
Throws:
ClassCastException