use of android.icu.impl.coll.CollationSettings in project j2objc by google.
the class RuleBasedCollator method setAlternateHandlingDefault.
/**
* 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()
*/
public void setAlternateHandlingDefault() {
checkNotFrozen();
CollationSettings defaultSettings = getDefaultSettings();
if (settings.readOnly() == defaultSettings) {
return;
}
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setAlternateHandlingDefault(defaultSettings.options);
setFastLatinOptions(ownedSettings);
}
use of android.icu.impl.coll.CollationSettings in project j2objc by google.
the class RuleBasedCollator method setStrength.
/**
* 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.
*/
@Override
public void setStrength(int newStrength) {
checkNotFrozen();
if (newStrength == getStrength()) {
return;
}
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setStrength(newStrength);
setFastLatinOptions(ownedSettings);
}
use of android.icu.impl.coll.CollationSettings in project j2objc by google.
the class RuleBasedCollator method setDecomposition.
/**
* Sets the decomposition mode of this Collator. Setting this
* decomposition attribute with CANONICAL_DECOMPOSITION allows the
* Collator to handle un-normalized text properly, producing the
* same results as if the text were normalized. If
* NO_DECOMPOSITION is set, it is the user's responsibility to
* insure that all text is already in the appropriate form before
* a comparison or before getting a CollationKey. Adjusting
* decomposition mode allows the user to select between faster and
* more complete collation behavior.
*
* <p>Since a great many of the world's languages do not require
* text normalization, most locales set NO_DECOMPOSITION as the
* default decomposition mode.
*
* The default decompositon mode for the Collator is
* NO_DECOMPOSITON, unless specified otherwise by the locale used
* to create the Collator.
*
* <p>See getDecomposition for a description of decomposition
* mode.
*
* @param decomposition the new decomposition mode
* @see #getDecomposition
* @see #NO_DECOMPOSITION
* @see #CANONICAL_DECOMPOSITION
* @throws IllegalArgumentException If the given value is not a valid
* decomposition mode.
*/
@Override
public void setDecomposition(int decomposition) {
checkNotFrozen();
boolean flag;
switch(decomposition) {
case NO_DECOMPOSITION:
flag = false;
break;
case CANONICAL_DECOMPOSITION:
flag = true;
break;
default:
throw new IllegalArgumentException("Wrong decomposition mode.");
}
if (flag == settings.readOnly().getFlag(CollationSettings.CHECK_FCD)) {
return;
}
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setFlag(CollationSettings.CHECK_FCD, flag);
setFastLatinOptions(ownedSettings);
}
use of android.icu.impl.coll.CollationSettings in project j2objc by google.
the class RuleBasedCollator method setNumericCollationDefault.
/**
* Method to set numeric collation to its default value.
*
* @see #getNumericCollation
* @see #setNumericCollation
*/
public void setNumericCollationDefault() {
checkNotFrozen();
CollationSettings defaultSettings = getDefaultSettings();
if (settings.readOnly() == defaultSettings) {
return;
}
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setFlagDefault(CollationSettings.NUMERIC, defaultSettings.options);
setFastLatinOptions(ownedSettings);
}
use of android.icu.impl.coll.CollationSettings in project j2objc by google.
the class RuleBasedCollator method setStrengthDefault.
/**
* 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
*/
public void setStrengthDefault() {
checkNotFrozen();
CollationSettings defaultSettings = getDefaultSettings();
if (settings.readOnly() == defaultSettings) {
return;
}
CollationSettings ownedSettings = getOwnedSettings();
ownedSettings.setStrengthDefault(defaultSettings.options);
setFastLatinOptions(ownedSettings);
}
Aggregations