Enum Class Locales.Score
- All Implemented Interfaces:
Serializable
,Comparable<Locales.Score>
,Constable
- Enclosing class:
Locales
Locale match scores. These are actually bits, so the score reflects exactly, what
elements did match and what didn't while at the same time providing a way determine
how close the match was:
* The most important element is the language, score 8, weight 1.
* The second most important element is the script, score 4, weight 2.
* The third most important element is the country, score 2, weight 4.
* The least important element is the variant, score 1, weight 8.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
didMatch
(int score) int
score()
static Locales.Score
Returns the enum constant of this class with the specified name.static Locales.Score[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.int
weight()
-
Enum Constant Details
-
LANGUAGE
-
SCRIPT
-
COUNTRY
-
VARIANT
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
score
public int score() -
weight
public int weight() -
didMatch
public boolean didMatch(int score)
-