Package com.ibm.icu.impl.units
Class UnitsData.CategoriesSink
- java.lang.Object
-
- com.ibm.icu.impl.UResource.Sink
-
- com.ibm.icu.impl.units.UnitsData.CategoriesSink
-
- Enclosing class:
- UnitsData
public static class UnitsData.CategoriesSink extends UResource.Sink
A Resource Sink that collects information fromunitQuantities
in theunits
resource to provide key->value lookups from base unit to category, as well as preserving ordering information for these categories. Seeunits.txt
. For example: "kilogram" -> "mass", "meter-per-second" -> "speed". In Java unitQuantity values are collected in order into an ArrayList, while unitQuantity key-to-index lookups are handled with a HashMap.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ArrayList<java.lang.String>
categories
(package private) java.util.HashMap<java.lang.String,java.lang.Integer>
mapFromUnitToIndex
Contains the map between units in their base units into their category.
-
Constructor Summary
Constructors Constructor Description CategoriesSink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
put(UResource.Key key, UResource.Value value, boolean noFallback)
Called once for each bundle (child-parent-...-root).
-
-
-
Method Detail
-
put
public void put(UResource.Key key, UResource.Value value, boolean noFallback)
Description copied from class:UResource.Sink
Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.- Specified by:
put
in classUResource.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.
-
-