Class ChainableComparator

    • Constructor Detail

      • ChainableComparator

        public ChainableComparator​(Comparator<Hit> secondaryComparator)
        Creates this comparator, given a secondary comparator, or null if there is no secondary
    • Method Detail

      • getSecondaryComparator

        public Comparator<Hit> getSecondaryComparator()
        Returns the comparator to use to compare hits which are equal according to this, or null if none
      • compare

        public int compare​(Hit first,
                           Hit second)
        Returns the comparison form the secondary comparison, or 0 if the secondary is null. When overriding this in the subclass, always return super.compare(first,second) at the end of the subclass' implementation.
        Specified by:
        compare in interface Comparator<Hit>