Known-Items Task Evaluation

Class OverlapComparator

java.lang.Object
  |
  +--OverlapComparator
All Implemented Interfaces:
java.util.Comparator

public class OverlapComparator
extends java.lang.Object
implements java.util.Comparator

A class that implements the java.util.Comparator interface to compare two items regarding their overlapping. You can set two parameters representing the minimal pourcentages of overlapping of respectively the the submitted system item and the reference item. Default overlapping values are 1/3 for system items and 2/3 for reference items.


Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares its two arguments for ordering them.
static OverlapComparator getInstance()
          Returns the unique instance of this class.
static OverlapComparator getInstance(double pSys, double pRef)
          Returns the unique instance of this class and set the parameters.
static double getPRef()
          Gets the reference item overlapping parameter.
static double getPSys()
          Sets the system item overlapping parameter.
static void setPRef(double pRef)
          Sets the reference item overlapping parameter.
static void setPSys(double pSys)
          Sets the system item overlapping parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

setPRef

public static void setPRef(double pRef)
Sets the reference item overlapping parameter.

setPSys

public static void setPSys(double pSys)
Sets the system item overlapping parameter.

getPRef

public static double getPRef()
Gets the reference item overlapping parameter.

getPSys

public static double getPSys()
Sets the system item overlapping parameter.

getInstance

public static OverlapComparator getInstance(double pSys,
                                            double pRef)
Returns the unique instance of this class and set the parameters.

getInstance

public static OverlapComparator getInstance()
Returns the unique instance of this class.

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
            throws java.lang.ClassCastException
Compares its two arguments for ordering them. Uses the overlapping parameter to check the equality.
Specified by:
compare in interface java.util.Comparator
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Throws:
java.lang.ClassCastException - Thrown if one of the arguments is not a item instance.

Known-Items Task Evaluation

For information over@nist.gov or rtaban@nist.gov