Class UnitPreferences.UnitPreferencesSink

java.lang.Object
com.ibm.icu.impl.UResource.Sink
com.ibm.icu.impl.units.UnitPreferences.UnitPreferencesSink
Enclosing class:
UnitPreferences

public static class UnitPreferences.UnitPreferencesSink extends UResource.Sink
  • Field Details

  • Constructor Details

    • UnitPreferencesSink

      public UnitPreferencesSink()
  • Method Details

    • getMapToUnitPreferences

      public HashMap<String,HashMap<String,UnitPreferences.UnitPreference[]>> getMapToUnitPreferences()
    • put

      public void put(UResource.Key key, UResource.Value value, boolean noFallback)
      The unitPreferenceData structure (see icu4c/source/data/misc/units.txt) contains a hierarchy of category/usage/region, within which are a set of preferences. Hence three for-loops and another loop for the preferences themselves.
      Specified by:
      put in class UResource.Sink
      Parameters:
      key - Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.
      value - Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.
      noFallback - true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.
    • insertUnitPreferences

      private void insertUnitPreferences(String category, String usage, String region, UnitPreferences.UnitPreference[] unitPreferences)