public final class RuleBasedCollator extends Collator
RuleBasedCollator is a concrete subclass of Collator. It allows customization of the Collator via user-specified rule sets. RuleBasedCollator is designed to be fully compliant to the Unicode Collation Algorithm (UCA) and conforms to ISO 14651.
A Collator is thread-safe only when frozen. See isFrozen()
and Freezable
.
Users are strongly encouraged to read the User Guide for more information about the collation service before using this class.
Create a RuleBasedCollator from a locale by calling the getInstance(Locale) factory method in the base class Collator. Collator.getInstance(Locale) creates a RuleBasedCollator object based on the collation rules defined by the argument locale. If a customized collation ordering or attributes is required, use the RuleBasedCollator(String) constructor with the appropriate rules. The customized RuleBasedCollator will base its ordering on the CLDR root collation, while re-adjusting the attributes and orders of the characters in the specified rule accordingly.
RuleBasedCollator provides correct collation orders for most locales supported in ICU. If specific data for a locale is not available, the orders eventually falls back to the CLDR root sort order.
For information about the collation rule syntax and details about customization, please refer to the Collation customization section of the User Guide.
Note that there are some differences between the Collation rule syntax used in Java and ICU4J:
Examples
Creating Customized RuleBasedCollators:
Concatenating rules to combineString simple = "& a < b < c < d"; RuleBasedCollator simpleCollator = new RuleBasedCollator(simple); String norwegian = "& a , A < b , B < c , C < d , D < e , E " + "< f , F < g , G < h , H < i , I < j , " + "J < k , K < l , L < m , M < n , N < " + "o , O < p , P < q , Q <r , R <s , S < " + "t , T < u , U < v , V < w , W < x , X " + "< y , Y < z , Z < \u00E5 = a\u030A " + ", \u00C5 = A\u030A ; aa , AA < \u00E6 " + ", \u00C6 < \u00F8 , \u00D8"; RuleBasedCollator norwegianCollator = new RuleBasedCollator(norwegian);
Collator
s: Making changes to an existing RuleBasedCollator to create a new// Create an en_US Collator object RuleBasedCollator en_USCollator = (RuleBasedCollator) Collator.getInstance(new Locale("en", "US", "")); // Create a da_DK Collator object RuleBasedCollator da_DKCollator = (RuleBasedCollator) Collator.getInstance(new Locale("da", "DK", "")); // Combine the two // First, get the collation rules from en_USCollator String en_USRules = en_USCollator.getRules(); // Second, get the collation rules from da_DKCollator String da_DKRules = da_DKCollator.getRules(); RuleBasedCollator newCollator = new RuleBasedCollator(en_USRules + da_DKRules); // newCollator has the combined rules
Collator
object, by appending changes to
the existing rule: How to change the order of non-spacing accents:// Create a new Collator object with additional rules String addRules = "& C < ch, cH, Ch, CH"; RuleBasedCollator myCollator = new RuleBasedCollator(en_USCollator.getRules() + addRules); // myCollator contains the new rules
Putting in a new primary ordering before the default setting, e.g. sort English characters before or after Japanese characters in the Japanese// old rule with main accents String oldRules = "= \u0301 ; \u0300 ; \u0302 ; \u0308 " + "; \u0327 ; \u0303 ; \u0304 ; \u0305 " + "; \u0306 ; \u0307 ; \u0309 ; \u030A " + "; \u030B ; \u030C ; \u030D ; \u030E " + "; \u030F ; \u0310 ; \u0311 ; \u0312 " + "< a , A ; ae, AE ; \u00e6 , \u00c6 " + "< b , B < c, C < e, E & C < d , D"; // change the order of accent characters String addOn = "& \u0300 ; \u0308 ; \u0302"; RuleBasedCollator myCollator = new RuleBasedCollator(oldRules + addOn);
Collator
: // get en_US Collator rules RuleBasedCollator en_USCollator = (RuleBasedCollator)Collator.getInstance(Locale.US); // add a few Japanese characters to sort before English characters // suppose the last character before the first base letter 'a' in // the English collation rule is \u2212 String jaString = "& \u2212 <\u3041, \u3042 <\u3043, " + "\u3044"; RuleBasedCollator myJapaneseCollator = new RuleBasedCollator(en_USCollator.getRules() + jaString);
This class is not subclassable
Collator.CollatorFactory, Collator.ReorderCodes
CANONICAL_DECOMPOSITION, FULL_DECOMPOSITION, IDENTICAL, NO_DECOMPOSITION, PRIMARY, QUATERNARY, SECONDARY, TERTIARY
Constructor and Description |
---|
RuleBasedCollator(String rules)
Constructor that takes the argument rules for customization.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones the RuleBasedCollator
|
RuleBasedCollator |
cloneAsThawed()
Provides for the clone operation.
|
int |
compare(String source,
String target)
Compares the source text String to the target text String according to the collation rules, strength and
decomposition mode for this RuleBasedCollator.
|
protected int |
doCompare(CharSequence left,
CharSequence right)
Deprecated.
This API is ICU internal only.
|
boolean |
equals(Object obj)
Compares the equality of two Collator objects.
|
Collator |
freeze()
Freezes the collator.
|
CollationElementIterator |
getCollationElementIterator(CharacterIterator source)
Return a CollationElementIterator for the given CharacterIterator.
|
CollationElementIterator |
getCollationElementIterator(String source)
Return a CollationElementIterator for the given String.
|
CollationElementIterator |
getCollationElementIterator(UCharacterIterator source)
Return a CollationElementIterator for the given UCharacterIterator.
|
CollationKey |
getCollationKey(String source)
Get a Collation key for the argument String source from this RuleBasedCollator.
|
void |
getContractionsAndExpansions(UnicodeSet contractions,
UnicodeSet expansions,
boolean addPrefixes)
Gets unicode sets containing contractions and/or expansions of a collator
|
int |
getDecomposition()
Returns the decomposition mode of this Collator.
|
ULocale |
getLocale(ULocale.Type type)
[icu] Returns the locale that was used to create this object, or null.
|
int |
getMaxVariable()
[icu] Returns the maximum reordering group whose characters are affected by
the alternate handling behavior.
|
boolean |
getNumericCollation()
Method to retrieve the numeric collation value.
|
RawCollationKey |
getRawCollationKey(String source,
RawCollationKey key)
Gets the simpler form of a CollationKey for the String source following the rules of this Collator and stores the
result into the user provided argument key.
|
int[] |
getReorderCodes()
Retrieves the reordering codes for this collator.
|
String |
getRules()
Gets the collation tailoring rules for this RuleBasedCollator.
|
String |
getRules(boolean fullrules)
Returns current rules.
|
int |
getStrength()
Returns this Collator's strength attribute.
|
UnicodeSet |
getTailoredSet()
Get a UnicodeSet that contains all the characters and sequences tailored in this collator.
|
VersionInfo |
getUCAVersion()
Get the UCA version of this collator object.
|
int |
getVariableTop()
[icu] Gets the variable top value of a Collator.
|
VersionInfo |
getVersion()
Get the version of this collator object.
|
int |
hashCode()
Generates a unique hash code for this RuleBasedCollator.
|
long[] |
internalGetCEs(CharSequence str)
Deprecated.
This API is ICU internal only.
|
boolean |
isAlternateHandlingShifted()
Checks if the alternate handling behavior is the UCA defined SHIFTED or NON_IGNORABLE.
|
boolean |
isCaseLevel()
Checks if case level is set to true.
|
boolean |
isFrenchCollation()
Checks if French Collation is set to true.
|
boolean |
isFrozen()
Determines whether the object has been frozen or not.
|
boolean |
isHiraganaQuaternary()
Deprecated.
ICU 50 Implementation detail, cannot be set via API, was removed from implementation.
|
boolean |
isLowerCaseFirst()
Return true if a lowercase character is sorted before the corresponding uppercase character.
|
boolean |
isUpperCaseFirst()
Return true if an uppercase character is sorted before the corresponding lowercase character.
|
void |
setAlternateHandlingDefault()
Sets the alternate handling mode to the initial mode set during construction of the RuleBasedCollator.
|
void |
setAlternateHandlingShifted(boolean shifted)
Sets the alternate handling for QUATERNARY strength to be either shifted or non-ignorable.
|
void |
setCaseFirstDefault()
Sets the case first mode to the initial mode set during construction of the RuleBasedCollator.
|
void |
setCaseLevel(boolean flag)
When case level is set to true, an additional weight is formed between the SECONDARY and TERTIARY weight, known
as the case level.
|
void |
setCaseLevelDefault()
Sets the case level mode to the initial mode set during construction of the RuleBasedCollator.
|
void |
setDecomposition(int decomposition)
Sets the decomposition mode of this Collator.
|
void |
setDecompositionDefault()
Sets the decomposition mode to the initial mode set during construction of the RuleBasedCollator.
|
void |
setFrenchCollation(boolean flag)
Sets the mode for the direction of SECONDARY weights to be used in French collation.
|
void |
setFrenchCollationDefault()
Sets the French collation mode to the initial mode set during construction of the RuleBasedCollator.
|
void |
setHiraganaQuaternary(boolean flag)
Deprecated.
ICU 50 Implementation detail, cannot be set via API, was removed from implementation.
|
void |
setHiraganaQuaternaryDefault()
Deprecated.
ICU 50 Implementation detail, cannot be set via API, was removed from implementation.
|
void |
setLowerCaseFirst(boolean lowerfirst)
Sets the orders of lower cased characters to sort before upper cased characters, in strength TERTIARY.
|
RuleBasedCollator |
setMaxVariable(int group)
[icu] Sets the variable top to the top of the specified reordering group.
|
void |
setNumericCollation(boolean flag)
[icu] When numeric collation is turned on, this Collator makes
substrings of digits sort according to their numeric values.
|
void |
setNumericCollationDefault()
Method to set numeric collation to its default value.
|
void |
setReorderCodes(int... order)
Sets the reordering codes for this collator.
|
void |
setStrength(int newStrength)
Sets this Collator's strength attribute.
|
void |
setStrengthDefault()
Sets the collation strength to the initial mode set during the construction of the RuleBasedCollator.
|
void |
setUpperCaseFirst(boolean upperfirst)
Sets whether uppercase characters sort before lowercase characters or vice versa, in strength TERTIARY.
|
void |
setVariableTop(int varTop)
Deprecated.
ICU 53 Call setMaxVariable() instead.
|
int |
setVariableTop(String varTop)
Deprecated.
ICU 53 Call
setMaxVariable(int) instead. |
compare, equals, getAvailableLocales, getAvailableULocales, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getEquivalentReorderCodes, getFunctionalEquivalent, getFunctionalEquivalent, getInstance, getInstance, getInstance, getKeywords, getKeywordValues, getKeywordValuesForLocale, registerFactory, registerInstance, setStrength2, unregister
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public RuleBasedCollator(String rules) throws Exception
Constructor that takes the argument rules for customization. The collator will be based on the CLDR root collation, with the attributes and re-ordering of the characters specified in the argument rules.
See the User Guide's section on Collation Customization for details on the rule syntax.
rules
- the collation rules to build the collation table from.ParseException
- and IOException thrown. ParseException thrown when argument rules have an invalid syntax.
IOException thrown when an error occurred while reading internal data.Exception
public Object clone() throws CloneNotSupportedException
clone
in class Collator
CloneNotSupportedException
public CollationElementIterator getCollationElementIterator(String source)
CollationElementIterator
public CollationElementIterator getCollationElementIterator(CharacterIterator source)
CollationElementIterator
public CollationElementIterator getCollationElementIterator(UCharacterIterator source)
CollationElementIterator
public boolean isFrozen()
An unfrozen Collator is mutable and not thread-safe. A frozen Collator is immutable and thread-safe.
public Collator freeze()
public RuleBasedCollator cloneAsThawed()
cloneAsThawed
in interface Freezable<Collator>
cloneAsThawed
in class Collator
@Deprecated public void setHiraganaQuaternary(boolean flag)
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.
flag
- true if Hiragana Quaternary mode is to be on, false otherwisesetHiraganaQuaternaryDefault()
,
isHiraganaQuaternary()
@Deprecated public void setHiraganaQuaternaryDefault()
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.
public void setUpperCaseFirst(boolean upperfirst)
upperfirst
- true to sort uppercase characters before lowercase characters, false to sort lowercase characters
before uppercase charactersisLowerCaseFirst()
,
isUpperCaseFirst()
,
setLowerCaseFirst(boolean)
,
setCaseFirstDefault()
public void setLowerCaseFirst(boolean lowerfirst)
lowerfirst
- true for sorting lower cased characters before upper cased characters, false to ignore case
preferences.isLowerCaseFirst()
,
isUpperCaseFirst()
,
setUpperCaseFirst(boolean)
,
setCaseFirstDefault()
public final void setCaseFirstDefault()
isLowerCaseFirst()
,
isUpperCaseFirst()
,
setLowerCaseFirst(boolean)
,
setUpperCaseFirst(boolean)
public void setAlternateHandlingDefault()
setAlternateHandlingShifted(boolean)
,
isAlternateHandlingShifted()
public void setCaseLevelDefault()
setCaseLevel(boolean)
,
isCaseLevel()
public void setDecompositionDefault()
getDecomposition()
,
setDecomposition(int)
public void setFrenchCollationDefault()
isFrenchCollation()
,
setFrenchCollation(boolean)
public void setStrengthDefault()
setStrength(int)
,
getStrength()
public void setNumericCollationDefault()
getNumericCollation()
,
setNumericCollation(boolean)
public void setFrenchCollation(boolean flag)
flag
- true to set the French collation on, false to set it offisFrenchCollation()
,
setFrenchCollationDefault()
public void setAlternateHandlingShifted(boolean shifted)
shifted
- true if SHIFTED behavior for alternate handling is desired, false for the NON_IGNORABLE behavior.isAlternateHandlingShifted()
,
setAlternateHandlingDefault()
public void setCaseLevel(boolean flag)
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. If the value is false, it 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. The default setting in a Collator object depends on the locale data loaded from the resources.
See the section on case level for more information.
flag
- true if case level sorting is required, false otherwisesetCaseLevelDefault()
,
isCaseLevel()
public void setDecomposition(int decomposition)
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.
See getDecomposition for a description of decomposition mode.
setDecomposition
in class Collator
decomposition
- the new decomposition modeIllegalArgumentException
- If the given value is not a valid
decomposition mode.getDecomposition()
,
Collator.NO_DECOMPOSITION
,
Collator.CANONICAL_DECOMPOSITION
public void setStrength(int newStrength)
See the Collator class description for an example of use.
setStrength
in class Collator
newStrength
- the new strength value.IllegalArgumentException
- If the new strength value is not one of PRIMARY, SECONDARY, TERTIARY, QUATERNARY or IDENTICAL.getStrength()
,
setStrengthDefault()
,
Collator.PRIMARY
,
Collator.SECONDARY
,
Collator.TERTIARY
,
Collator.QUATERNARY
,
Collator.IDENTICAL
public RuleBasedCollator setMaxVariable(int group)
setMaxVariable
in class Collator
group
- one of Collator.ReorderCodes.SPACE, Collator.ReorderCodes.PUNCTUATION,
Collator.ReorderCodes.SYMBOL, Collator.ReorderCodes.CURRENCY;
or Collator.ReorderCodes.DEFAULT to restore the default max variable groupgetMaxVariable()
public int getMaxVariable()
getMaxVariable
in class Collator
setMaxVariable(int)
@Deprecated public int setVariableTop(String varTop)
setMaxVariable(int)
instead.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 setMaxVariable(int)
.
setVariableTop
in class Collator
varTop
- one or more (if contraction) characters to which the variable top should be setIllegalArgumentException
- is thrown if varTop argument is not a valid variable top element. A variable top element is
invalid when
getVariableTop()
,
setAlternateHandlingShifted(boolean)
@Deprecated public void setVariableTop(int varTop)
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 setMaxVariable(int)
.
setVariableTop
in class Collator
varTop
- primary weight, as returned by setVariableTop or getVariableTopgetVariableTop()
,
setVariableTop(String)
public void setNumericCollation(boolean flag)
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.
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.
flag
- true to turn numeric collation on and false to turn it offgetNumericCollation()
,
setNumericCollationDefault()
public void setReorderCodes(int... order)
Collator.ReorderCodes
entries.
By default, reordering codes specified for the start of the order are placed in the
order given after several special non-script blocks. These special groups of characters
are space, punctuation, symbol, currency, and digit. These special groups are represented with
Collator.ReorderCodes
entries. Script groups can be intermingled with
these special non-script groups if those special groups are explicitly specified in the reordering.
The special code OTHERS
stands for any script that is not explicitly
mentioned in the list of reordering codes given. Anything that is after OTHERS
will go at the very end of the reordering in the order given.
The special reorder code DEFAULT
will reset the reordering for this collator
to the default for this collator. The default reordering may be the DUCET/CLDR order or may be a reordering that
was specified when this collator was created from resource data or from rules. The
DEFAULT code must be the sole code supplied when it is used.
If not, then an IllegalArgumentException
will be thrown.
The special reorder code NONE
will remove any reordering for this collator.
The result of setting no reordering will be to have the DUCET/CLDR ordering used. The
NONE code must be the sole code supplied when it is used.
setReorderCodes
in class Collator
order
- the reordering codes to apply to this collator; if this is null or an empty array
then this clears any existing reorderingIllegalArgumentException
- if the reordering codes are malformed in any way (e.g. duplicates, multiple reset codes, overlapping equivalent scripts)getReorderCodes()
,
Collator.getEquivalentReorderCodes(int)
,
Collator.ReorderCodes
,
UScript
public String getRules()
getRules(boolean)
public String getRules(boolean fullrules)
The root collation rules are an approximation of the root collator's sort order. They are almost never used or useful at runtime and can be removed from the data. See User Guide: Collation Customization, Building on Existing Locales
getRules()
should normally be used instead.
fullrules
- true if the rules that defines the full set of collation order is required, otherwise false for
returning only the tailored rulesgetRules()
public UnicodeSet getTailoredSet()
getTailoredSet
in class Collator
public void getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions, boolean addPrefixes) throws Exception
contractions
- if not null, set to contain contractionsexpansions
- if not null, set to contain expansionsaddPrefixes
- add the prefix contextual elements to contractionsException
- Throws an exception if any errors occurs.public CollationKey getCollationKey(String source)
Get a Collation key for the argument String source from this RuleBasedCollator.
General recommendation:
If comparison are to be done to the same String multiple times, it would be more efficient to generate
CollationKeys for the Strings and use CollationKey.compareTo(CollationKey) for the comparisons. If the each
Strings are compared to only once, using the method RuleBasedCollator.compare(String, String) will have a better
performance.
See the class documentation for an explanation about CollationKeys.
getCollationKey
in class Collator
source
- the text String to be transformed into a collation key.CollationKey
,
compare(String, String)
,
getRawCollationKey(java.lang.String, com.ibm.icu.text.RawCollationKey)
public RawCollationKey getRawCollationKey(String source, RawCollationKey key)
getRawCollationKey
in class Collator
source
- the text String to be transformed into a RawCollationKeykey
- output RawCollationKey to store resultsgetCollationKey(java.lang.String)
,
compare(String, String)
,
RawCollationKey
@Deprecated public long[] internalGetCEs(CharSequence str)
str
- the stringpublic int getStrength()
[icu] Note: This can return QUATERNARY strength, which is not supported by the JDK version.
See the Collator class description for more details.
getStrength
in class Collator
setStrength(int)
,
Collator.PRIMARY
,
Collator.SECONDARY
,
Collator.TERTIARY
,
Collator.QUATERNARY
,
Collator.IDENTICAL
public int getDecomposition()
See the Collator class description for more details.
getDecomposition
in class Collator
setDecomposition(int)
,
Collator.NO_DECOMPOSITION
,
Collator.CANONICAL_DECOMPOSITION
public boolean isUpperCaseFirst()
setUpperCaseFirst(boolean)
,
setLowerCaseFirst(boolean)
,
isLowerCaseFirst()
,
setCaseFirstDefault()
public boolean isLowerCaseFirst()
setUpperCaseFirst(boolean)
,
setLowerCaseFirst(boolean)
,
isUpperCaseFirst()
,
setCaseFirstDefault()
public boolean isAlternateHandlingShifted()
setAlternateHandlingShifted(boolean)
,
setAlternateHandlingDefault()
public boolean isCaseLevel()
setCaseLevelDefault()
,
isCaseLevel()
,
setCaseLevel(boolean)
public boolean isFrenchCollation()
setFrenchCollation(boolean)
,
setFrenchCollationDefault()
@Deprecated public boolean isHiraganaQuaternary()
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.
setHiraganaQuaternaryDefault()
,
setHiraganaQuaternary(boolean)
public int getVariableTop()
getVariableTop
in class Collator
getMaxVariable()
public boolean getNumericCollation()
setNumericCollation(boolean)
,
setNumericCollationDefault()
public int[] getReorderCodes()
getReorderCodes
in class Collator
setReorderCodes(int...)
,
Collator.getEquivalentReorderCodes(int)
public boolean equals(Object obj)
The base class checks for null and for equal types. Subclasses should override.
equals
in interface Comparator<Object>
equals
in class Collator
obj
- the Collator to compare to.public int hashCode()
public int compare(String source, String target)
General recommendation:
If comparison are to be done to the same String multiple times, it would be more efficient to generate
CollationKeys for the Strings and use CollationKey.compareTo(CollationKey) for the comparisons. If speed
performance is critical and object instantiation is to be reduced, further optimization may be achieved by
generating a simpler key of the form RawCollationKey and reusing this RawCollationKey object with the method
RuleBasedCollator.getRawCollationKey. Internal byte representation can be directly accessed via RawCollationKey
and stored for future use. Like CollationKey, RawCollationKey provides a method RawCollationKey.compareTo for key
comparisons. If the each Strings are compared to only once, using the method RuleBasedCollator.compare(String,
String) will have a better performance.
compare
in class Collator
source
- the source text String.target
- the target text String.CollationKey
,
getCollationKey(java.lang.String)
@Deprecated protected int doCompare(CharSequence left, CharSequence right)
public VersionInfo getVersion()
getVersion
in class Collator
public VersionInfo getUCAVersion()
getUCAVersion
in class Collator
public ULocale getLocale(ULocale.Type type)
Note: This method will be implemented in ICU 3.0; ICU 2.8 contains a partial preview implementation. The actual locale is returned correctly, but the valid locale is not, in most cases.
The base class method always returns ULocale.ROOT
.
Subclasses should override it if appropriate.
getLocale
in class Collator
type
- type of information requested, either ULocale.VALID_LOCALE
or ULocale.ACTUAL_LOCALE
.ULocale
,
ULocale.VALID_LOCALE
,
ULocale.ACTUAL_LOCALE
Copyright © 2016 Unicode, Inc. and others.