Class ScoreComparator
- java.lang.Object
-
- org.silverpeas.core.index.search.model.ScoreComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<MatchingIndexEntry>
public class ScoreComparator extends Object implements Comparator<MatchingIndexEntry>, Serializable
Comparator used to sort the results set.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ScoreComparator
comparator
-
Constructor Summary
Constructors Constructor Description ScoreComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(MatchingIndexEntry r1, MatchingIndexEntry r2)
A matching index entry is greater another if his score is higher.-
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
comparator
public static final ScoreComparator comparator
-
-
Method Detail
-
compare
public int compare(MatchingIndexEntry r1, MatchingIndexEntry r2)
A matching index entry is greater another if his score is higher. This result is reversed as we want a descending sort.- Specified by:
compare
in interfaceComparator<MatchingIndexEntry>
- Parameters:
r1
- matching index entryr2
- other matching index entry to compare
-
-