marf.util.comparators
Class ResultComparator

java.lang.Object
  extended by marf.util.SortComparator
      extended by 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
 
Fields inherited from class marf.util.SortComparator
ASCENDING, DESCENDING, iSortMode
 
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 marf.util.SortComparator
getSortMode
 
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
 

Constructor Detail

ResultComparator

public ResultComparator(int piMethod)
Takes the sorting mode into consideration.

Parameters:
piMethod - sorting method, either ASCENDING or DESCENDING
Method Detail

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 comparison
poResult2 - 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


SourceForge Logo