crn.comparators
Class DepartureHoursOfDayComparator

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

public class DepartureHoursOfDayComparator
extends java.lang.Object
implements IEComparator

A class used to compare departure hours of day.

Author:
Piotrek

Field Summary
static int MAX_SIMILAR_HOURS_DIFFERENCE
          Defines the maximal difference between two similar hours.
 
Constructor Summary
DepartureHoursOfDayComparator()
           
 
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_HOURS_DIFFERENCE

public static int MAX_SIMILAR_HOURS_DIFFERENCE
Defines the maximal difference between two similar hours.

Constructor Detail

DepartureHoursOfDayComparator

public DepartureHoursOfDayComparator()
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)