Class UnitPreferences

java.lang.Object
com.ibm.icu.impl.units.UnitPreferences

public class UnitPreferences extends Object
  • Field Details

  • Constructor Details

    • UnitPreferences

      public UnitPreferences()
  • Method Details

    • formMapKey

      public static String formMapKey(String category, String usage)
    • getAllUsages

      private static String[] getAllUsages(String usage)
      Extracts all the sub-usages from a usage including the default one in the end. The usages will be in order starting with the longest matching one. For example: if usage : "person-height-child" the function will return: "person-height-child" "person-height" "person" "default"
      Parameters:
      usage -
      Returns:
    • getPreferencesFor

      public UnitPreferences.UnitPreference[] getPreferencesFor(String category, String usage, ULocale locale, UnitsData data)
    • getUnitPreferences

      private UnitPreferences.UnitPreference[] getUnitPreferences(String category, String usage, String region)
      Parameters:
      category -
      usage -
      region -
      Returns:
      null if there is no entry associated to the category and usage. O.W. returns the corresponding UnitPreference[]