Package com.ibm.icu.impl.coll
Class CollationSettings
- java.lang.Object
-
- com.ibm.icu.impl.coll.SharedObject
-
- com.ibm.icu.impl.coll.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.icu.impl.coll.SharedObject
SharedObject.Reference<T extends SharedObject>
-
-
Field Summary
Fields Modifier and Type Field Description static intBACKWARD_SECONDARYOptions bit 11: Compare secondary weights backwards.static intCASE_FIRSTOptions 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).static intCASE_FIRST_AND_UPPER_MASKOptions bit mask for caseFirst and upperFirst, before shifting.static intCASE_LEVELOptions bit 10: Insert the case level between the secondary and tertiary levels.static intCHECK_FCDOptions bit 0: Perform the FCD check on the input text and deliver normalized text.intfastLatinOptionsOptions for CollationFastLatin.char[]fastLatinPrimariesstatic intNUMERICOptions bit 1: Numeric collation.intoptionsCHECK_FCD etc.int[]reorderCodesArray of reorder codes; ignored if length == 0.byte[]reorderTable256-byte table for reordering permutation of primary lead bytes; null if no reordering.longvariableTopVariable-top primary weight.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollationSettingsclone()Initializes refCount to 0.voidcopyReorderingFrom(CollationSettings other)booleandontCheckFCD()booleanequals(Object other)Compares this instance with the specified object and indicates if they are equal.booleangetAlternateHandling()intgetCaseFirst()booleangetFlag(int bit)intgetMaxVariable()intgetStrength()inthashCode()Returns an integer hash code for this object.booleanhasReordering()booleanisNumeric()longreorder(long p)voidresetReordering()voidsetAlternateHandlingDefault(int defaultOptions)voidsetAlternateHandlingShifted(boolean value)voidsetCaseFirst(int value)voidsetCaseFirstDefault(int defaultOptions)voidsetFlag(int bit, boolean value)Sets the options bit for an on/off attribute.voidsetFlagDefault(int bit, int defaultOptions)voidsetMaxVariable(int value, int defaultOptions)voidsetReordering(CollationData data, int[] codes)voidsetStrength(int value)voidsetStrengthDefault(int defaultOptions)-
Methods inherited from class com.ibm.icu.impl.coll.SharedObject
addRef, deleteIfZeroRefCount, getRefCount, removeRef
-
-
-
-
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
-
clone
public CollationSettings clone()
Description copied from class:SharedObjectInitializes refCount to 0.- Overrides:
clonein classSharedObject- Returns:
- a copy of this object.
-
equals
public boolean equals(Object other)
Description copied from class:ObjectCompares this instance with the specified object and indicates if they are equal. In order to be equal,omust 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
trueonly ifthis == o. See Writing a correctequalsmethod if you intend implementing your ownequalsmethod.The general contract for the
equalsandObject.hashCode()methods is that ifequalsreturnstruefor any two objects, thenhashCode()must return the same value for these objects. This means that subclasses ofObjectusually override either both methods or neither of them.- Overrides:
equalsin classObject- Parameters:
other- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
hashCode
public int hashCode()
Description copied from class:ObjectReturns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually 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
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classObject- 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)
-
copyReorderingFrom
public void copyReorderingFrom(CollationSettings other)
-
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()
-
-