Package com.ibm.icu.impl.units
Class UnitsConverter
java.lang.Object
com.ibm.icu.impl.units.UnitsConverter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
(package private) static class
Responsible for all the Factor operation NOTE: This class is immutable -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnitsConverter
(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates) Constructor ofUnitsConverter
.UnitsConverter
(String sourceIdentifier, String targetIdentifier) Constructor ofUnitsConverter
. -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
areDimensionsZeroes
(HashMap<String, Integer> dimensionMap) convert
(BigDecimal inputValue) convertInverse
(BigDecimal inputValue) extractConvertibility
(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates) private static void
insertInMap
(HashMap<String, Integer> dimensionMap, ArrayList<SingleUnitImpl> singleUnits, int multiplier) HelperstoString()
-
Field Details
-
conversionRate
-
reciprocal
private boolean reciprocal -
offset
-
-
Constructor Details
-
UnitsConverter
Constructor ofUnitsConverter
. NOTE: - source and target must be under the same category - e.g. meter to mile --> both of them are length units.NOTE: This constructor creates an instance of
UnitsConverter
internally.- Parameters:
sourceIdentifier
- represents the source unit identifier.targetIdentifier
- represents the target unit identifier.
-
UnitsConverter
public UnitsConverter(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates) Constructor ofUnitsConverter
. NOTE: - source and target must be under the same category - e.g. meter to mile --> both of them are length units.- Parameters:
source
- represents the source unit.target
- represents the target unit.conversionRates
- contains all the needed conversion rates.
-
-
Method Details
-
extractConvertibility
public static UnitsConverter.Convertibility extractConvertibility(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates) -
insertInMap
private static void insertInMap(HashMap<String, Integer> dimensionMap, ArrayList<SingleUnitImpl> singleUnits, int multiplier) Helpers -
areDimensionsZeroes
-
convert
-
convertInverse
-
getConversionInfo
-
toString
-