public static enum LocaleMatcher.Demotion extends Enum<LocaleMatcher.Demotion>
LocaleMatcher.Builder.setDemotionPerDesiredLocale(LocaleMatcher.Demotion)
Enum Constant and Description |
---|
NONE
All desired locales are treated equally.
|
REGION
Earlier desired locales are preferred.
|
Modifier and Type | Method and Description |
---|---|
static LocaleMatcher.Demotion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LocaleMatcher.Demotion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LocaleMatcher.Demotion NONE
public static final LocaleMatcher.Demotion REGION
From each desired locale to the next, the distance to any supported locale is increased by an additional amount which is at least as large as most region mismatches. A later desired locale has to have a better match with some supported locale due to more than merely having the same region subtag.
For example: Supported={en, sv} desired=[en-GB, sv]
yields Result(en-GB, en)
because
with the demotion of sv its perfect match is no better than
the region distance between the earlier desired locale en-GB and en=en-US.
Notes:
public static LocaleMatcher.Demotion[] values()
for (LocaleMatcher.Demotion c : LocaleMatcher.Demotion.values()) System.out.println(c);
public static LocaleMatcher.Demotion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2016 Unicode, Inc. and others.