crn.comparators
Class LocationsComparator

java.lang.Object
  extended bycrn.comparators.LocationsComparator
All Implemented Interfaces:
IEComparator

public class LocationsComparator
extends java.lang.Object
implements IEComparator

A class used to compare the locations.

Author:
Piotrek

Field Summary
static double MAX_SIMILAR_LOCATIONS_DISTANCE
          Defines a maximal distance between two locations to consider them similar.
 
Constructor Summary
LocationsComparator()
           
 
Method Summary
 float CompareIEs(IE ie1, IE ie2)
          Compares two IEs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SIMILAR_LOCATIONS_DISTANCE

public static double MAX_SIMILAR_LOCATIONS_DISTANCE
Defines a maximal distance between two locations to consider them similar.

Constructor Detail

LocationsComparator

public LocationsComparator()
Method Detail

CompareIEs

public float CompareIEs(IE ie1,
                        IE ie2)
Description copied from interface: IEComparator
Compares two IEs. The returned value is a similarity percentage and therefore must be in range [0..1].

Specified by:
CompareIEs in interface IEComparator
Parameters:
ie1 - The first of the IEs to be compared.
ie2 - The second of the IEs to be compared.
Returns:
The similarity measure of these two IEs or -1 in case of any error (like the value was not of the expected type).
See Also:
IEComparator.CompareIEs(crn.IE, crn.IE)