marf.util.comparators
Class ResultComparator
java.lang.Object
marf.util.SortComparator
marf.util.comparators.ResultComparator
- All Implemented Interfaces:
- java.io.Serializable, java.util.Comparator
public class ResultComparator
- extends SortComparator
Compares two Result objects for equality.
Used in sorting.
$Id: ResultComparator.java,v 1.16 2007/12/23 06:29:58 mokhov Exp $
- Since:
- 0.3.0.2
- Version:
- $Revision: 1.16 $
- Author:
- Serguei Mokhov
- See Also:
- Serialized Form
Field Summary |
private static long |
serialVersionUID
For serialization versioning. |
Constructor Summary |
ResultComparator(int piMethod)
Takes the sorting mode into consideration. |
Method Summary |
int |
compare(java.lang.Object poResult1,
java.lang.Object poResult2)
Implementation of the Comparator interface for the Result objects. |
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
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 |
serialVersionUID
private static final long serialVersionUID
- For serialization versioning.
When adding new members or make other structural
changes regenerate this number with the
serialver
tool that comes with JDK.
- Since:
- 0.3.0.4
- See Also:
- Constant Field Values
ResultComparator
public ResultComparator(int piMethod)
- Takes the sorting mode into consideration.
- Parameters:
piMethod
- sorting method, either ASCENDING or DESCENDING
compare
public int compare(java.lang.Object poResult1,
java.lang.Object poResult2)
- Implementation of the Comparator interface for the Result objects.
To decide on inequality of the Results objects we compare
their outcome (distance or probability) value only. Takes into
consideration ASCENDING or DESCENDING order of sorting.
- Parameters:
poResult1
- first Result object for comparisonpoResult2
- second Result object for comparison
- Returns:
- 0 if the objects are equal, 1 if the 2nd is greater then the 1st
under ASCENDING, or the 1st is greater then the 2nd under DESCENDING.
Otherwise, -1 is returned.
getMARFSourceCodeRevision
public static java.lang.String getMARFSourceCodeRevision()
- Returns source code revision information.
- Returns:
- revision string