at.tuwien.ifs.somtoolbox.visualization.clustering
Class NodeDistance
java.lang.Object
at.tuwien.ifs.somtoolbox.visualization.clustering.NodeDistance
- All Implemented Interfaces:
- java.lang.Comparable<NodeDistance>
public class NodeDistance
- extends java.lang.Object
- implements java.lang.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 4206 2011-03-28 17:32:55Z mayer $
- Author:
- Angela Roiger
Method Summary |
int |
compareTo(NodeDistance o)
|
boolean |
equals(java.lang.Object o)
Compare this Node distance to another Object. |
int |
hashCode()
Must be equal if the objects are equal according to nodeDistance.equal. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
n1
ClusterNode n1
n2
ClusterNode n2
dist
protected double dist
NodeDistance
public NodeDistance(ClusterNode no1,
ClusterNode no2,
double d)
equals
public boolean equals(java.lang.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 java.lang.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 java.lang.Object
compareTo
public int compareTo(NodeDistance o)
throws java.lang.ClassCastException
- Specified by:
compareTo
in interface java.lang.Comparable<NodeDistance>
- Throws:
java.lang.ClassCastException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object