Package com.yahoo.search.result
Class HitSortOrderer
java.lang.Object
com.yahoo.search.result.HitOrderer
com.yahoo.search.result.HitSortOrderer
A hit orderer which can be assigned to a HitGroup to keep that group's
hit sorted in accordance with the sorting specification given when this is created.
- Author:
- Steinar Knutsen
-
Constructor Summary
ConstructorDescriptionHitSortOrderer
(Sorting sorting) Create a sort order from a sortingHitSortOrderer
(Comparator<Hit> comparator) Create a sort order from a comparator. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Comparator that this HitOrderer uses internally to sort hits.void
Orders the given list of hits according to the sorting given at construction Meta hits are sorted before concrete hits, but have no internal ordering.
-
Constructor Details
-
HitSortOrderer
Create a sort order from a sorting -
HitSortOrderer
Create a sort order from a comparator. This will be appended to the standard comparators used by this.
-
-
Method Details
-
order
Orders the given list of hits according to the sorting given at construction Meta hits are sorted before concrete hits, but have no internal ordering. The sorting is stable.- Specified by:
order
in classHitOrderer
-
getComparator
Description copied from class:HitOrderer
Returns the Comparator that this HitOrderer uses internally to sort hits. Returns null if no Comparator is used.This default implementation returns null.
- Overrides:
getComparator
in classHitOrderer
- Returns:
- the Comparator used to order hits, or null
-