Class LongComparator


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

      • values

        private final long[] values
      • topValue

        protected long topValue
      • bottom

        protected long bottom
    • Constructor Detail

      • LongComparator

        public LongComparator​(int numHits,
                              java.lang.String field,
                              java.lang.Long missingValue,
                              boolean reverse,
                              Pruning pruning)
    • 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.Long>
        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.Long value​(int slot)
        Description copied from class: FieldComparator
        Return the actual value in the slot.
        Specified by:
        value in class FieldComparator<java.lang.Long>
        Parameters:
        slot - the value
        Returns:
        value in this slot