Class BytesRefComparator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int comparedBytesCount  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BytesRefComparator​(int comparedBytesCount)
      Sole constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract int byteAt​(BytesRef ref, int i)
      Return the unsigned byte to use for comparison at index i, or -1 if all bytes that are useful for comparisons are exhausted.
      int compare​(BytesRef o1, BytesRef o2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • comparedBytesCount

        final int comparedBytesCount
    • Constructor Detail

      • BytesRefComparator

        protected BytesRefComparator​(int comparedBytesCount)
        Sole constructor.
        Parameters:
        comparedBytesCount - the maximum number of bytes to compare.
    • Method Detail

      • byteAt

        protected abstract int byteAt​(BytesRef ref,
                                      int i)
        Return the unsigned byte to use for comparison at index i, or -1 if all bytes that are useful for comparisons are exhausted. This may only be called with a value of i between 0 included and comparedBytesCount excluded.
      • compare

        public int compare​(BytesRef o1,
                           BytesRef o2)
        Specified by:
        compare in interface java.util.Comparator<BytesRef>