crn.comparators
Class ChangesCountsComparator

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

public class ChangesCountsComparator
extends java.lang.Object
implements IEComparator

A class used to compare the changes counts.

Author:
Piotrek

Field Summary
static int MAX_SIMILAR_CHANGES_COUNTS_DIFFERENCE
          Defines the maximal difference between similar changes counts.
 
Constructor Summary
ChangesCountsComparator()
           
 
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_CHANGES_COUNTS_DIFFERENCE

public static int MAX_SIMILAR_CHANGES_COUNTS_DIFFERENCE
Defines the maximal difference between similar changes counts.

Constructor Detail

ChangesCountsComparator

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