Class Collation


  • public final class Collation
    extends Object
    Collation v2 basic definitions and static helper functions. Data structures except for expansion tables store 32-bit CEs which are either specials (see tags below) or are compact forms of 64-bit CEs.
    • Field Detail

      • SENTINEL_CP

        public static final int SENTINEL_CP
        UChar32 U_SENTINEL. TODO: Create a common, public constant?
        See Also:
        Constant Field Values
      • MERGE_SEPARATOR_BYTE

        public static final int MERGE_SEPARATOR_BYTE
        Merge-sort-key separator. Same as the unique primary and identical-level weights of U+FFFE. Must not be used as primary compression low terminator. Otherwise usable.
        See Also:
        Constant Field Values
      • MERGE_SEPARATOR_PRIMARY

        public static final long MERGE_SEPARATOR_PRIMARY
        See Also:
        Constant Field Values
      • PRIMARY_COMPRESSION_LOW_BYTE

        public static final int PRIMARY_COMPRESSION_LOW_BYTE
        Primary compression low terminator, must be greater than MERGE_SEPARATOR_BYTE. Reserved value in primary second byte if the lead byte is compressible. Otherwise usable in all CE weight bytes.
        See Also:
        Constant Field Values
      • PRIMARY_COMPRESSION_HIGH_BYTE

        public static final int PRIMARY_COMPRESSION_HIGH_BYTE
        Primary compression high terminator. Reserved value in primary second byte if the lead byte is compressible. Otherwise usable in all CE weight bytes.
        See Also:
        Constant Field Values
      • COMMON_SEC_AND_TER_CE

        public static final int COMMON_SEC_AND_TER_CE
        Lower 32 bits of a CE with common secondary and tertiary weights.
        See Also:
        Constant Field Values
      • ONLY_TERTIARY_MASK

        public static final int ONLY_TERTIARY_MASK
        Only the 2*6 bits for the pure tertiary weight.
        See Also:
        Constant Field Values
      • CASE_AND_QUATERNARY_MASK

        public static final int CASE_AND_QUATERNARY_MASK
        Case bits and quaternary bits.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Collation

        public Collation()
    • Method Detail

      • makeCE

        public static long makeCE​(long p)
        Creates a CE from a primary weight.
      • incTwoBytePrimaryByOffset

        public static long incTwoBytePrimaryByOffset​(long basePrimary,
                                                     boolean isCompressible,
                                                     int offset)
        Increments a 2-byte primary by a code point offset.
      • incThreeBytePrimaryByOffset

        public static long incThreeBytePrimaryByOffset​(long basePrimary,
                                                       boolean isCompressible,
                                                       int offset)
        Increments a 3-byte primary by a code point offset.