Enum Class Locales.Score

java.lang.Object
java.lang.Enum<Locales.Score>
ch.tocco.nice2.textresources.api.i18n.Locales.Score
All Implemented Interfaces:
Serializable, Comparable<Locales.Score>, Constable
Enclosing class:
Locales

public static enum Locales.Score extends Enum<Locales.Score>
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.
  • Enum Constant Details

  • Method Details

    • values

      public static Locales.Score[] 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

      public static Locales.Score valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • score

      public int score()
    • weight

      public int weight()
    • didMatch

      public boolean didMatch(int score)