Class UnitsRouter
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.units.UnitsRouter
UnitsRouter responsible for converting from a single unit (such as meter or
meter-per-second) to one of the complex units based on the limits.
For example:
if the input is meter and the output as following
{foot+inch, limit: 3.0}
{inch , limit: no value (-inf)}
Thus means if the input in meter is greater than or equal to 3.0 feet,
the output will be in foot+inch, otherwise, the output will be in inch.
NOTE:
the output units and their limits MUST BE in order, for example, if the output units, from the
previous example, are the following:
{inch , limit: no value (-inf)}
{foot+inch, limit: 3.0}
IN THIS CASE THE OUTPUT WILL BE ALWAYS IN inch.
NOTE: the output units and their limits will be extracted from the units preferences database by knowing the followings: - input unit - locale - usage
DESIGN:
UnitRouter uses internally ComplexUnitConverter in order to convert the input
units to the desired complex units and to check the limit too.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains the complex unit converter and the limit which representing the smallest value that the converter should accept.class -
Constructor Summary
ConstructorsConstructorDescriptionUnitsRouter(String inputUnitIdentifier, ULocale locale, String usage) UnitsRouter(MeasureUnitImpl inputUnit, ULocale locale, String usage) -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of possible output units, i.e.route(BigDecimal quantity, MicroProps micros) If micros.rounder is a BogusRounder, this function replaces it with a valid one.
-
Constructor Details
-
UnitsRouter
-
UnitsRouter
-
-
Method Details
-
route
If micros.rounder is a BogusRounder, this function replaces it with a valid one. -
getOutputUnits
Returns the list of possible output units, i.e. the full set of preferences, for the localized, usage-specific unit preferences.The returned pointer should be valid for the lifetime of the UnitsRouter instance.
-