Top Description Fields Constructors Methods
com.ibm.icu.impl.coll

public final Class CollationSettings

extends SharedObject
Class Inheritance
Imports
java.util.Arrays, com.ibm.icu.text.Collator

Collation settings/options/attributes. These are the values that can be changed via API.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
ALTERNATE_MASK

Options bits 3..2: Alternate-handling mask.

public static final int
BACKWARD_SECONDARY

Options bit 11: Compare secondary weights backwards.

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).

public static final int
CASE_FIRST_AND_UPPER_MASK

Options bit mask for caseFirst and upperFirst, before shifting.

public static final int
CASE_LEVEL

Options bit 10: Insert the case level between the secondary and tertiary levels.

public static final int
CHECK_FCD

Options bit 0: Perform the FCD check on the input text and deliver normalized text.

private static final int[]
public int
fastLatinOptions

Options for CollationFastLatin.

public char[]
pack-priv static final int
pack-priv static final int
pack-priv static final int
MAX_VAR_SPACE

maxVariable values

pack-priv static final int
pack-priv static final int
MAX_VARIABLE_MASK

maxVariable options bit mask before shifting.

pack-priv static final int
MAX_VARIABLE_SHIFT

Options bits 6..4: The 3-bit maxVariable value bit field is shifted by this value.

pack-priv long
minHighNoReorder

Limit of last reordered range.

public static final int
NUMERIC

Options bit 1: Numeric collation.

public int
options

CHECK_FCD etc.

public int[]
reorderCodes

Array of reorder codes; ignored if length == 0.

pack-priv long[]
reorderRanges

Primary-weight ranges for script reordering, to be used by reorder(p) for split-reordered primary lead bytes.

public byte[]
reorderTable

256-byte table for reordering permutation of primary lead bytes; null if no reordering.

pack-priv static final int
SHIFTED

"Shifted" alternate handling, see ALTERNATE_MASK.

pack-priv static final int
STRENGTH_MASK

Strength options bit mask before shifting.

pack-priv static final int
STRENGTH_SHIFT

Options bits 15..12: The 4-bit strength value bit field is shifted by this value.

pack-priv static final int
UPPER_FIRST

Options bit 8: Sort uppercase first if caseLevel or caseFirst is on.

public long
variableTop

Variable-top primary weight.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
aliasReordering(CollationData data, int[] codesAndRanges, int codesLength, byte[] table)

public CollationSettings
clone()

Overrides com.ibm.icu.impl.coll.SharedObject.clone.

Initializes refCount to 0.
public void
public boolean
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public boolean
public int
public boolean
getFlag(int bit)

public int
pack-priv static int
getStrength(int options)

public int
pack-priv static int
getTertiaryMask(int options)

pack-priv boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
pack-priv static boolean
isTertiaryWithCaseBits(int options)

Include case bits in the tertiary level if caseLevel=off and caseFirst!=off.

public long
reorder(long p)

private long
reorderEx(long p)

private static boolean
public void
public void
setAlternateHandlingDefault(int defaultOptions)

public void
public void
setCaseFirst(int value)

public void
setCaseFirstDefault(int defaultOptions)

public void
setFlag(int bit, boolean value)

Sets the options bit for an on/off attribute.

public void
setFlagDefault(int bit, int defaultOptions)

public void
setMaxVariable(int value, int defaultOptions)

private void
setReorderArrays(int[] codes, int[] ranges, int rangesStart, int rangesLength, byte[] table)

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

private void
setReorderRanges(int[] ranges, int rangesStart, int rangesLength)

public void
setStrength(int value)

public void
setStrengthDefault(int defaultOptions)

pack-priv static boolean
Inherited from com.ibm.icu.impl.coll.SharedObject:
addRefdeleteIfZeroRefCountgetRefCountremoveRef

Field Detail

ALTERNATE_MASKback to summary
pack-priv static final int ALTERNATE_MASK

Options bits 3..2: Alternate-handling mask. 0 for non-ignorable. Reserve values 8 and 0xc for shift-trimmed and blanked.

BACKWARD_SECONDARYback to summary
public static final int BACKWARD_SECONDARY

Options bit 11: Compare secondary weights backwards. ("French secondary")

CASE_FIRSTback to summary
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.

CASE_FIRST_AND_UPPER_MASKback to summary
public static final int CASE_FIRST_AND_UPPER_MASK

Options bit mask for caseFirst and upperFirst, before shifting. Same value as caseFirst==upperFirst.

CASE_LEVELback to summary
public static final int CASE_LEVEL

Options bit 10: Insert the case level between the secondary and tertiary levels.

CHECK_FCDback to summary
public static final int CHECK_FCD

Options bit 0: Perform the FCD check on the input text and deliver normalized text.

EMPTY_INT_ARRAYback to summary
private static final int[] EMPTY_INT_ARRAY
fastLatinOptionsback to summary
public int fastLatinOptions

Options for CollationFastLatin. Negative if disabled.

fastLatinPrimariesback to summary
public char[] fastLatinPrimaries
MAX_VAR_CURRENCYback to summary
pack-priv static final int MAX_VAR_CURRENCY
MAX_VAR_PUNCTback to summary
pack-priv static final int MAX_VAR_PUNCT
MAX_VAR_SPACEback to summary
pack-priv static final int MAX_VAR_SPACE

maxVariable values

MAX_VAR_SYMBOLback to summary
pack-priv static final int MAX_VAR_SYMBOL
MAX_VARIABLE_MASKback to summary
pack-priv static final int MAX_VARIABLE_MASK

maxVariable options bit mask before shifting.

MAX_VARIABLE_SHIFTback to summary
pack-priv static final int MAX_VARIABLE_SHIFT

Options bits 6..4: The 3-bit maxVariable value bit field is shifted by this value.

minHighNoReorderback to summary
pack-priv long minHighNoReorder

Limit of last reordered range. 0 if no reordering or no split bytes.

NUMERICback to summary
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.

optionsback to summary
public int options

CHECK_FCD etc.

reorderCodesback to summary
public int[] reorderCodes

Array of reorder codes; ignored if length == 0.

reorderRangesback to summary
pack-priv long[] reorderRanges

Primary-weight ranges for script reordering, to be used by reorder(p) for split-reordered primary lead bytes.

Each entry is a (limit, offset) pair. The upper 16 bits of the entry are the upper 16 bits of the exclusive primary limit of a range. Primaries between the previous limit and this one have their lead bytes modified by the signed offset (-0xff..+0xff) stored in the lower 16 bits.

CollationData.makeReorderRanges() writes a full list where the first range (at least for terminators and separators) has a 0 offset. The last range has a non-zero offset. minHighNoReorder is set to the limit of that last range.

In the settings object, the initial ranges before the first split lead byte are omitted for efficiency; they are handled by reorder(p) via the reorderTable. If there are no split-reordered lead bytes, then no ranges are needed.

reorderTableback to summary
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.

SHIFTEDback to summary
pack-priv static final int SHIFTED

"Shifted" alternate handling, see ALTERNATE_MASK.

STRENGTH_MASKback to summary
pack-priv static final int STRENGTH_MASK

Strength options bit mask before shifting.

STRENGTH_SHIFTback to summary
pack-priv static final int STRENGTH_SHIFT

Options bits 15..12: The 4-bit strength value bit field is shifted by this value. It is the top used bit field in the options. (No need to mask after shifting.)

UPPER_FIRSTback to summary
pack-priv static final int UPPER_FIRST

Options bit 8: Sort uppercase first if caseLevel or caseFirst is on.

variableTopback to summary
public long variableTop

Variable-top primary weight.

Constructor Detail

CollationSettingsback to summary
pack-priv CollationSettings()

Method Detail

aliasReorderingback to summary
pack-priv void aliasReordering(CollationData data, int[] codesAndRanges, int codesLength, byte[] table)
cloneback to summary
public CollationSettings clone()

Overrides com.ibm.icu.impl.coll.SharedObject.clone.

Doc from com.ibm.icu.impl.coll.SharedObject.clone.

Initializes refCount to 0.

Returns:CollationSettings

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
copyReorderingFromback to summary
public void copyReorderingFrom(CollationSettings other)
dontCheckFCDback to summary
public boolean dontCheckFCD()
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAlternateHandlingback to summary
public boolean getAlternateHandling()
getCaseFirstback to summary
public int getCaseFirst()
getFlagback to summary
public boolean getFlag(int bit)
getMaxVariableback to summary
public int getMaxVariable()
getStrengthback to summary
pack-priv static int getStrength(int options)
getStrengthback to summary
public int getStrength()
getTertiaryMaskback to summary
pack-priv static int getTertiaryMask(int options)
hasBackwardSecondaryback to summary
pack-priv boolean hasBackwardSecondary()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
hasReorderingback to summary
public boolean hasReordering()
isNumericback to summary
public boolean isNumeric()
isTertiaryWithCaseBitsback to summary
pack-priv static boolean isTertiaryWithCaseBits(int options)

Include case bits in the tertiary level if caseLevel=off and caseFirst!=off.

reorderback to summary
public long reorder(long p)
reorderExback to summary
private long reorderEx(long p)
reorderTableHasSplitBytesback to summary
private static boolean reorderTableHasSplitBytes(byte[] table)
resetReorderingback to summary
public void resetReordering()
setAlternateHandlingDefaultback to summary
public void setAlternateHandlingDefault(int defaultOptions)
setAlternateHandlingShiftedback to summary
public void setAlternateHandlingShifted(boolean value)
setCaseFirstback to summary
public void setCaseFirst(int value)
setCaseFirstDefaultback to summary
public void setCaseFirstDefault(int defaultOptions)
setFlagback to summary
public void setFlag(int bit, boolean value)

Sets the options bit for an on/off attribute.

setFlagDefaultback to summary
public void setFlagDefault(int bit, int defaultOptions)
setMaxVariableback to summary
public void setMaxVariable(int value, int defaultOptions)
setReorderArraysback to summary
private void setReorderArrays(int[] codes, int[] ranges, int rangesStart, int rangesLength, byte[] table)
setReorderingback to summary
public void setReordering(CollationData data, int[] codes)
setReorderRangesback to summary
private void setReorderRanges(int[] ranges, int rangesStart, int rangesLength)
setStrengthback to summary
public void setStrength(int value)
setStrengthDefaultback to summary
public void setStrengthDefault(int defaultOptions)
sortsTertiaryUpperCaseFirstback to summary
pack-priv static boolean sortsTertiaryUpperCaseFirst(int options)