Class 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 sorting
      HitSortOrderer​(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HitSortOrderer

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

        public HitSortOrderer​(java.util.Comparator<Hit> comparator)
        Create a sort order from a comparator. This will be appended to the standard comparators used by this.
    • 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 class HitOrderer
      • 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 class HitOrderer
        Returns:
        the Comparator used to order hits, or null