Class CollationSettings

  • All Implemented Interfaces:
    Cloneable

    public final class CollationSettings
    extends SharedObject
    Collation settings/options/attributes. These are the values that can be changed via API.
    • Field Detail

      • CHECK_FCD

        public static final int CHECK_FCD
        Options bit 0: Perform the FCD check on the input text and deliver normalized text.
        See Also:
        Constant Field Values
      • NUMERIC

        public static final int NUMERIC
        Options bit 1: Numeric collation. Also known as CODAN = COllate Digits As Numbers. Treat digit sequences as numbers with CE sequences in numeric order, rather than returning a normal CE for each digit.
        See Also:
        Constant Field Values
      • CASE_FIRST

        public static final int CASE_FIRST
        Options bit 9: Keep the case bits in the tertiary weight (they trump other tertiary values) unless case level is on (when they are *moved* into the separate case level). By default, the case bits are removed from the tertiary weight (ignored). When CASE_FIRST is off, UPPER_FIRST must be off too, corresponding to the tri-value UCOL_CASE_FIRST attribute: UCOL_OFF vs. UCOL_LOWER_FIRST vs. UCOL_UPPER_FIRST.
        See Also:
        Constant Field Values
      • CASE_FIRST_AND_UPPER_MASK

        public static final int CASE_FIRST_AND_UPPER_MASK
        Options bit mask for caseFirst and upperFirst, before shifting. Same value as caseFirst==upperFirst.
        See Also:
        Constant Field Values
      • CASE_LEVEL

        public static final int CASE_LEVEL
        Options bit 10: Insert the case level between the secondary and tertiary levels.
        See Also:
        Constant Field Values
      • BACKWARD_SECONDARY

        public static final int BACKWARD_SECONDARY
        Options bit 11: Compare secondary weights backwards. ("French secondary")
        See Also:
        Constant Field Values
      • options

        public int options
        CHECK_FCD etc.
      • variableTop

        public long variableTop
        Variable-top primary weight.
      • reorderTable

        public byte[] reorderTable
        256-byte table for reordering permutation of primary lead bytes; null if no reordering. A 0 entry at a non-zero index means that the primary lead byte is "split" (there are different offsets for primaries that share that lead byte) and the reordering offset must be determined via the reorderRanges.
      • reorderCodes

        public int[] reorderCodes
        Array of reorder codes; ignored if length == 0.
      • fastLatinOptions

        public int fastLatinOptions
        Options for CollationFastLatin. Negative if disabled.
      • fastLatinPrimaries

        public char[] fastLatinPrimaries
    • Method Detail

      • equals

        public boolean equals​(Object other)
        Description copied from class: Object
        Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

        The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

        The general contract for the equals and Object.hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

        Overrides:
        equals in class Object
        Parameters:
        other - the object to compare this instance with.
        Returns:
        true if the specified object is equal to this Object; false otherwise.
        See Also:
        Object.hashCode()
      • hashCode

        public int hashCode()
        Description copied from class: Object
        Returns an integer hash code for this object. By contract, any two objects for which Object.equals(java.lang.Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

        Note that hash values must not change over time unless information used in equals comparisons also changes.

        See Writing a correct hashCode method if you intend implementing your own hashCode method.

        Overrides:
        hashCode in class Object
        Returns:
        this object's hash code.
        See Also:
        Object.equals(java.lang.Object)
      • resetReordering

        public void resetReordering()
      • setReordering

        public void setReordering​(CollationData data,
                                  int[] codes)
      • hasReordering

        public boolean hasReordering()
      • reorder

        public long reorder​(long p)
      • setStrength

        public void setStrength​(int value)
      • setStrengthDefault

        public void setStrengthDefault​(int defaultOptions)
      • getStrength

        public int getStrength()
      • setFlag

        public void setFlag​(int bit,
                            boolean value)
        Sets the options bit for an on/off attribute.
      • setFlagDefault

        public void setFlagDefault​(int bit,
                                   int defaultOptions)
      • getFlag

        public boolean getFlag​(int bit)
      • setCaseFirst

        public void setCaseFirst​(int value)
      • setCaseFirstDefault

        public void setCaseFirstDefault​(int defaultOptions)
      • getCaseFirst

        public int getCaseFirst()
      • setAlternateHandlingShifted

        public void setAlternateHandlingShifted​(boolean value)
      • setAlternateHandlingDefault

        public void setAlternateHandlingDefault​(int defaultOptions)
      • getAlternateHandling

        public boolean getAlternateHandling()
      • setMaxVariable

        public void setMaxVariable​(int value,
                                   int defaultOptions)
      • getMaxVariable

        public int getMaxVariable()
      • dontCheckFCD

        public boolean dontCheckFCD()
      • isNumeric

        public boolean isNumeric()