org.cdlib.xtf.textEngine
Class TotalHitsComparator.HitsComp

Object
  extended by TotalHitsComparator.HitsComp
All Implemented Interfaces:
ScoreDocComparator
Enclosing class:
TotalHitsComparator

private class TotalHitsComparator.HitsComp
extends Object
implements ScoreDocComparator


Field Summary
 
Fields inherited from interface ScoreDocComparator
INDEXORDER, RELEVANCE
 
Constructor Summary
private TotalHitsComparator.HitsComp()
           
 
Method Summary
 int compare(ScoreDoc d1, ScoreDoc d2)
          Compares two ScoreDoc objects and returns a result indicating their sort order.
 int sortType()
          Returns the type of sort.
 Comparable sortValue(ScoreDoc doc)
          Returns the value used to sort the given document.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TotalHitsComparator.HitsComp

private TotalHitsComparator.HitsComp()
Method Detail

compare

public int compare(ScoreDoc d1,
                   ScoreDoc d2)
Compares two ScoreDoc objects and returns a result indicating their sort order.

Specified by:
compare in interface ScoreDocComparator
Parameters:
d1 - First ScoreDoc
d2 - Second ScoreDoc
Returns:
-1 if i should come before j
1 if i should come after j
0 if they are equal
See Also:
Comparator

sortValue

public Comparable sortValue(ScoreDoc doc)
Returns the value used to sort the given document. The object returned must implement the java.io.Serializable interface. This is used by multisearchers to determine how to collate results from their searchers.

Specified by:
sortValue in interface ScoreDocComparator
Parameters:
doc - The document

sortType

public int sortType()
Returns the type of sort. Should return SortField.SCORE, SortField.DOC, SortField.STRING, SortField.INTEGER, SortField.FLOAT or SortField.CUSTOM. It is not valid to return SortField.AUTO. This is used by multisearchers to determine how to collate results from their searchers.

Specified by:
sortType in interface ScoreDocComparator
Returns:
One of the constants in SortField.
See Also:
SortField