Class UnsignedBytes.LexicographicalComparatorHolder

  • Enclosing class:
    UnsignedBytes

    static class UnsignedBytes.LexicographicalComparatorHolder
    extends java.lang.Object
    Provides a lexicographical comparator implementation; either a Java implementation or a faster implementation based on Unsafe.

    Uses reflection to gracefully fall back to the Java implementation if Unsafe isn't available.

    • Field Detail

      • UNSAFE_COMPARATOR_NAME

        static final java.lang.String UNSAFE_COMPARATOR_NAME
      • BEST_COMPARATOR

        static final java.util.Comparator<byte[]> BEST_COMPARATOR
    • Constructor Detail

      • LexicographicalComparatorHolder

        LexicographicalComparatorHolder()
    • Method Detail

      • getBestComparator

        static java.util.Comparator<byte[]> getBestComparator()
        Returns the Unsafe-using Comparator, or falls back to the pure-Java implementation if unable to do so.