/** * Sets the Hiragana Quaternary mode to the initial mode set during construction of the RuleBasedCollator. See * setHiraganaQuaternary(boolean) for more details. * * <p>This attribute was an implementation detail of the CLDR Japanese tailoring. * Since ICU 50, this attribute is not settable any more via API functions. * Since CLDR 25/ICU 53, explicit quaternary relations are used * to achieve the same Japanese sort order. * * @see #setHiraganaQuaternary(boolean) * @see #isHiraganaQuaternary * @deprecated ICU 50 Implementation detail, cannot be set via API, was removed from implementation. */ @Deprecated public void setHiraganaQuaternaryDefault() { checkNotFrozen(); }
/** * Sets the Hiragana Quaternary mode to be on or off. When the Hiragana Quaternary mode is turned on, the collator * positions Hiragana characters before all non-ignorable characters in QUATERNARY strength. This is to produce a * correct JIS collation order, distinguishing between Katakana and Hiragana characters. * * <p>This attribute was an implementation detail of the CLDR Japanese tailoring. * Since ICU 50, this attribute is not settable any more via API functions. * Since CLDR 25/ICU 53, explicit quaternary relations are used * to achieve the same Japanese sort order. * * @param flag * true if Hiragana Quaternary mode is to be on, false otherwise * @see #setHiraganaQuaternaryDefault * @see #isHiraganaQuaternary * @deprecated ICU 50 Implementation detail, cannot be set via API, was removed from implementation. */ @Deprecated public void setHiraganaQuaternary(boolean flag) { checkNotFrozen(); }
/** * {@icu} Sets the variable top to the specified primary weight. * * <p>Beginning with ICU 53, the variable top is pinned to * the top of one of the supported reordering groups, * and it must not be beyond the last of those groups. * See {@link #setMaxVariable(int)}. * * @param varTop primary weight, as returned by setVariableTop or getVariableTop * @see #getVariableTop * @see #setVariableTop(String) * @deprecated ICU 53 Call setMaxVariable() instead. */ @Override @Deprecated public void setVariableTop(int varTop) { checkNotFrozen(); internalSetVariableTop(varTop & 0xffffffffL); }
/** * Sets the mode for the direction of SECONDARY weights to be used in French collation. The default value is false, * which treats SECONDARY weights in the order they appear. If set to true, the SECONDARY weights will be sorted * backwards. See the section on <a href="http://userguide.icu-project.org/collation/architecture"> * French collation</a> for more information. * * @param flag * true to set the French collation on, false to set it off * @stable ICU 2.8 * @see #isFrenchCollation * @see #setFrenchCollationDefault */ public void setFrenchCollation(boolean flag) { checkNotFrozen(); if(flag == isFrenchCollation()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlag(CollationSettings.BACKWARD_SECONDARY, flag); setFastLatinOptions(ownedSettings); }
/** * Sets whether uppercase characters sort before lowercase characters or vice versa, in strength TERTIARY. The * default mode is false, and so lowercase characters sort before uppercase characters. If true, sort upper case * characters first. * * @param upperfirst * true to sort uppercase characters before lowercase characters, false to sort lowercase characters * before uppercase characters * @see #isLowerCaseFirst * @see #isUpperCaseFirst * @see #setLowerCaseFirst * @see #setCaseFirstDefault * @stable ICU 2.8 */ public void setUpperCaseFirst(boolean upperfirst) { checkNotFrozen(); if (upperfirst == isUpperCaseFirst()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setCaseFirst(upperfirst ? CollationSettings.CASE_FIRST_AND_UPPER_MASK : 0); setFastLatinOptions(ownedSettings); }
/** * Sets the alternate handling for QUATERNARY strength to be either shifted or non-ignorable. See the UCA definition * on <a href="http://www.unicode.org/unicode/reports/tr10/#Variable_Weighting">Variable Weighting</a>. This * attribute will only be effective when QUATERNARY strength is set. The default value for this mode is false, * corresponding to the NON_IGNORABLE mode in UCA. In the NON_IGNORABLE mode, the RuleBasedCollator treats all * the code points with non-ignorable primary weights in the same way. If the mode is set to true, the behavior * corresponds to SHIFTED defined in UCA, this causes code points with PRIMARY orders that are equal or below the * variable top value to be ignored in PRIMARY order and moved to the QUATERNARY order. * * @param shifted * true if SHIFTED behavior for alternate handling is desired, false for the NON_IGNORABLE behavior. * @see #isAlternateHandlingShifted * @see #setAlternateHandlingDefault * @stable ICU 2.8 */ public void setAlternateHandlingShifted(boolean shifted) { checkNotFrozen(); if(shifted == isAlternateHandlingShifted()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setAlternateHandlingShifted(shifted); setFastLatinOptions(ownedSettings); }
/** * Sets the orders of lower cased characters to sort before upper cased characters, in strength TERTIARY. The * default mode is false. If true is set, the RuleBasedCollator will sort lower cased characters before the upper * cased ones. Otherwise, if false is set, the RuleBasedCollator will ignore case preferences. * * @param lowerfirst * true for sorting lower cased characters before upper cased characters, false to ignore case * preferences. * @see #isLowerCaseFirst * @see #isUpperCaseFirst * @see #setUpperCaseFirst * @see #setCaseFirstDefault * @stable ICU 2.8 */ public void setLowerCaseFirst(boolean lowerfirst) { checkNotFrozen(); if (lowerfirst == isLowerCaseFirst()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setCaseFirst(lowerfirst ? CollationSettings.CASE_FIRST : 0); setFastLatinOptions(ownedSettings); }
/** * Sets the alternate handling mode to the initial mode set during construction of the RuleBasedCollator. See * setAlternateHandling(boolean) for more details. * * @see #setAlternateHandlingShifted(boolean) * @see #isAlternateHandlingShifted() * @stable ICU 2.8 */ public void setAlternateHandlingDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setAlternateHandlingDefault(defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * Method to set numeric collation to its default value. * * @see #getNumericCollation * @see #setNumericCollation * @stable ICU 2.8 */ public void setNumericCollationDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlagDefault(CollationSettings.NUMERIC, defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * Sets this Collator's strength attribute. The strength attribute determines the minimum level of difference * considered significant during comparison. * * <p>See the Collator class description for an example of use. * * @param newStrength * the new strength value. * @see #getStrength * @see #setStrengthDefault * @see #PRIMARY * @see #SECONDARY * @see #TERTIARY * @see #QUATERNARY * @see #IDENTICAL * @exception IllegalArgumentException * If the new strength value is not one of PRIMARY, SECONDARY, TERTIARY, QUATERNARY or IDENTICAL. * @stable ICU 2.8 */ @Override public void setStrength(int newStrength) { checkNotFrozen(); if(newStrength == getStrength()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setStrength(newStrength); setFastLatinOptions(ownedSettings); }
/** * Sets the case level mode to the initial mode set during construction of the RuleBasedCollator. See * setCaseLevel(boolean) for more details. * * @see #setCaseLevel(boolean) * @see #isCaseLevel * @stable ICU 2.8 */ public void setCaseLevelDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlagDefault(CollationSettings.CASE_LEVEL, defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * Sets the collation strength to the initial mode set during the construction of the RuleBasedCollator. See * setStrength(int) for more details. * * @see #setStrength(int) * @see #getStrength * @stable ICU 2.8 */ public void setStrengthDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setStrengthDefault(defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * <p> * When case level is set to true, an additional weight is formed between the SECONDARY and TERTIARY weight, known * as the case level. The case level is used to distinguish large and small Japanese Kana characters. Case level * could also be used in other situations. For example to distinguish certain Pinyin characters. The default value * is false, which means the case level is not generated. The contents of the case level are affected by the case * first mode. A simple way to ignore accent differences in a string is to set the strength to PRIMARY and enable * case level. * <p> * See the section on <a href="http://userguide.icu-project.org/collation/architecture">case * level</a> for more information. * * @param flag * true if case level sorting is required, false otherwise * @stable ICU 2.8 * @see #setCaseLevelDefault * @see #isCaseLevel */ public void setCaseLevel(boolean flag) { checkNotFrozen(); if(flag == isCaseLevel()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlag(CollationSettings.CASE_LEVEL, flag); setFastLatinOptions(ownedSettings); }
/** * Sets the decomposition mode to the initial mode set during construction of the RuleBasedCollator. See * setDecomposition(int) for more details. * * @see #getDecomposition * @see #setDecomposition(int) * @stable ICU 2.8 */ public void setDecompositionDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlagDefault(CollationSettings.CHECK_FCD, defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * Sets the French collation mode to the initial mode set during construction of the RuleBasedCollator. See * setFrenchCollation(boolean) for more details. * * @see #isFrenchCollation * @see #setFrenchCollation(boolean) * @stable ICU 2.8 */ public void setFrenchCollationDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlagDefault(CollationSettings.BACKWARD_SECONDARY, defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * Sets the case first mode to the initial mode set during construction of the RuleBasedCollator. See * setUpperCaseFirst(boolean) and setLowerCaseFirst(boolean) for more details. * * @see #isLowerCaseFirst * @see #isUpperCaseFirst * @see #setLowerCaseFirst(boolean) * @see #setUpperCaseFirst(boolean) * @stable ICU 2.8 */ public final void setCaseFirstDefault() { checkNotFrozen(); CollationSettings defaultSettings = getDefaultSettings(); if(settings.readOnly() == defaultSettings) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setCaseFirstDefault(defaultSettings.options); setFastLatinOptions(ownedSettings); }
/** * {@icu} When numeric collation is turned on, this Collator makes * substrings of digits sort according to their numeric values. * * <p>This is a way to get '100' to sort AFTER '2'. Note that the longest * digit substring that can be treated as a single unit is * 254 digits (not counting leading zeros). If a digit substring is * longer than that, the digits beyond the limit will be treated as a * separate digit substring. * * <p>A "digit" in this sense is a code point with General_Category=Nd, * which does not include circled numbers, roman numerals, etc. * Only a contiguous digit substring is considered, that is, * non-negative integers without separators. * There is no support for plus/minus signs, decimals, exponents, etc. * * @param flag * true to turn numeric collation on and false to turn it off * @see #getNumericCollation * @see #setNumericCollationDefault * @stable ICU 2.8 */ public void setNumericCollation(boolean flag) { checkNotFrozen(); // sort substrings of digits as numbers if(flag == getNumericCollation()) { return; } CollationSettings ownedSettings = getOwnedSettings(); ownedSettings.setFlag(CollationSettings.NUMERIC, flag); setFastLatinOptions(ownedSettings); }
public void setDecomposition(int decomposition) checkNotFrozen(); boolean flag; switch(decomposition) {
@Deprecated public int setVariableTop(String varTop) { checkNotFrozen(); if (varTop == null || varTop.length() == 0) { throw new IllegalArgumentException("Variable top argument string can not be null or zero in length.");
checkNotFrozen(); int length = (order != null) ? order.length : 0; if(length == 1 && order[0] == ReorderCodes.NONE) {