it.unimo.dbgroup.momis.tools
Class Distance

java.lang.Object
  extended byit.unimo.dbgroup.momis.tools.Distance
All Implemented Interfaces:
java.io.Serializable

public class Distance
extends java.lang.Object
implements java.io.Serializable

Generic class to handle the distance between two objects
Used to handle with generic weighted graphs and trees of Objects

Author:
Alberto Corni, Jul 2000
See Also:
Serialized Form

Field Summary
private  double _distance
          Distance between the two objects.
private  java.lang.Object _dst
          Destintion Object.
Second object involved in the distance.
private  java.lang.Object _src
          Source Object.
First object involved in the distance.
 
Constructor Summary
Distance(java.lang.Object src, java.lang.Object dst, double distance)
          Reads a file and put it in a string.
 
Method Summary
 double getDistance()
          Returns the distance between the two objects
 java.lang.Object getDst()
          Returns the destination object
 java.lang.Object getElementOtherThan(java.lang.Object o)
          Returns the object in the distance that is not o.
 java.lang.Object getSrc()
          Returns the source object
 java.lang.String toString()
          String representation.
 java.lang.String toTreeString()
          Tree String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_src

private java.lang.Object _src
Source Object.
First object involved in the distance.


_dst

private java.lang.Object _dst
Destintion Object.
Second object involved in the distance.


_distance

private double _distance
Distance between the two objects.

Constructor Detail

Distance

public Distance(java.lang.Object src,
                java.lang.Object dst,
                double distance)
Reads a file and put it in a string.

Method Detail

getSrc

public java.lang.Object getSrc()
Returns the source object


getDst

public java.lang.Object getDst()
Returns the destination object


getElementOtherThan

public java.lang.Object getElementOtherThan(java.lang.Object o)
Returns the object in the distance that is not o.
This could be useful if you uses asymmetrical graph where you know one of the two elements and are looking for the other.


getDistance

public double getDistance()
Returns the distance between the two objects


toString

public java.lang.String toString()
String representation.


toTreeString

public java.lang.String toTreeString()
Tree String representation.



Universita' di Modena e Reggio Emilia