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 Details

    • HitSortOrderer

      public HitSortOrderer(Sorting sorting)
      Create a sort order from a sorting
    • HitSortOrderer

      public HitSortOrderer(Comparator<Hit> comparator)
      Create a sort order from a comparator. This will be appended to the standard comparators used by this.
  • Method Details

    • order

      public void order(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 class HitOrderer
    • getComparator

      public 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 class HitOrderer
      Returns:
      the Comparator used to order hits, or null