marf.util
Class SortComparator

java.lang.Object
  extended by marf.util.SortComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator
Direct Known Subclasses:
FrequencyComparator, RankComparator, ResultComparator

public abstract class SortComparator
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

Sort Comparator is the base for all sorting operations in MARF.

$Id: SortComparator.java,v 1.10 2007/12/23 06:29:47 mokhov Exp $

Since:
0.3.0.2
Version:
$Revision: 1.10 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
static int ASCENDING
          Constant indicating to sort in the ascending order.
static int DESCENDING
          Constant indicating to sort in the descending order.
protected  int iSortMode
          Current sorting mode: either ASCENDING or DESCENDING.
 
Constructor Summary
SortComparator()
          When constructed, default mode is ASCENDING.
SortComparator(int piSortMode)
          When constructed, the mode is the one specified.
 
Method Summary
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 int getSortMode()
          Retrieves the current sorting mode.
 
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
compare, equals
 

Field Detail

ASCENDING

public static final int ASCENDING
Constant indicating to sort in the ascending order.

See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
Constant indicating to sort in the descending order.

See Also:
Constant Field Values

iSortMode

protected int iSortMode
Current sorting mode: either ASCENDING or DESCENDING.

Constructor Detail

SortComparator

public SortComparator()
When constructed, default mode is ASCENDING.


SortComparator

public SortComparator(int piSortMode)
When constructed, the mode is the one specified.

Parameters:
piSortMode - desired sorting mode of ASCENDING or DESCENDING.
Throws:
java.lang.IllegalArgumentException - is not ASCENDING or DESCENDING
Method Detail

getSortMode

public int getSortMode()
Retrieves the current sorting mode.

Returns:
the mode
Since:
0.3.0.3
See Also:
DESCENDING, ASCENDING

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Returns:
revision string


SourceForge Logo