Class IntComparator


  • public class IntComparator
    extends NumericComparator<java.lang.Integer>
    Comparator based on Integer.compare(int, int) for numHits. This comparator provides a skipping functionality – an iterator that can skip over non-competitive documents.
    • Field Detail

      • values

        private final int[] values
      • topValue

        protected int topValue
      • bottom

        protected int bottom
    • Constructor Detail

      • IntComparator

        public IntComparator​(int numHits,
                             java.lang.String field,
                             java.lang.Integer missingValue,
                             boolean reverse,
                             boolean enableSkipping)
    • Method Detail

      • compare

        public int compare​(int slot1,
                           int slot2)
        Description copied from class: FieldComparator
        Compare hit at slot1 with hit at slot2.
        Specified by:
        compare in class FieldComparator<java.lang.Integer>
        Parameters:
        slot1 - first slot to compare
        slot2 - second slot to compare
        Returns:
        any N < 0 if slot2's value is sorted after slot1, any N > 0 if the slot2's value is sorted before slot1 and 0 if they are equal
      • value

        public java.lang.Integer value​(int slot)
        Description copied from class: FieldComparator
        Return the actual value in the slot.
        Specified by:
        value in class FieldComparator<java.lang.Integer>
        Parameters:
        slot - the value
        Returns:
        value in this slot