Package com.ibm.icu.impl.units
Class UnitPreferences
java.lang.Object
com.ibm.icu.impl.units.UnitPreferences
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate HashMap
<String, HashMap<String, UnitPreferences.UnitPreference[]>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
formMapKey
(String category, String usage) private static String[]
getAllUsages
(String usage) Extracts all the sub-usages from a usage including the default one in the end.getPreferencesFor
(String category, String usage, ULocale locale, UnitsData data) private UnitPreferences.UnitPreference[]
getUnitPreferences
(String category, String usage, String region)
-
Field Details
-
measurementSystem
-
mapToUnitPreferences
-
-
Constructor Details
-
UnitPreferences
public UnitPreferences()
-
-
Method Details
-
formMapKey
-
getAllUsages
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[]
-