Package com.yahoo.search.result
Class HitSortOrderer
- java.lang.Object
-
- com.yahoo.search.result.HitOrderer
-
- com.yahoo.search.result.HitSortOrderer
-
public class HitSortOrderer extends HitOrderer
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
Constructors Constructor Description HitSortOrderer(Sorting sorting)
Create a sort order from a sortingHitSortOrderer(java.util.Comparator<Hit> comparator)
Create a sort order from a comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Comparator<Hit>
getComparator()
Returns the Comparator that this HitOrderer uses internally to sort hits.void
order(java.util.List<Hit> hits)
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.
-
-
-
Method Detail
-
order
public void order(java.util.List<Hit> hits)
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
public java.util.Comparator<Hit> 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
-
-