at.tuwien.ifs.somtoolbox.visualization.clustering
Class NodeDistance
java.lang.Object
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
n1
ClusterNode n1
n2
ClusterNode n2
dist
double dist
NodeDistance
public NodeDistance(ClusterNode no1,
ClusterNode no2,
double d)
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