marf.util
Class SortComparator

java.lang.Object
  |
  +--marf.util.SortComparator
All Implemented Interfaces:
java.util.Comparator, java.io.Serializable
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.6 2005/06/01 19:38:50 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.6 $
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 constsructed, default mode is ASCENDING.
SortComparator(int piSortMode)
          When constsructed, the mode is the one specified.
 
Method Summary
static java.lang.String getRevision()
          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
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 constsructed, default mode is ASCENDING.


SortComparator

public SortComparator(int piSortMode)
When constsructed, 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

getRevision

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

Returns:
revision string