Package com.ibm.icu.impl.units
Class UnitsConverter.Factor
java.lang.Object
com.ibm.icu.impl.units.UnitsConverter.Factor
- Enclosing class:
UnitsConverter
Responsible for all the Factor operation
NOTE:
This class is immutable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
Exponent for Atomic Mass Unitprivate int
Exponent for the ft_to_m constantprivate int
Exponent for Newtonian constant of gravitation "G".private int
Exponent for the imperial-gallon to cubic-meter conversion rate constantprivate int
Exponent for the glucose molar mass conversion rate constantprivate int
Exponent for gravity (gravity-of-earth, "g")private int
Exponent for the item per mole conversion rate constantprivate int
Exponent for the pound to kilogram conversion rate constantprivate int
Exponent for the meters per AU conversion rate constantprivate int
Exponent for PIprivate int
Exponent for the sec per julian year conversion rate constantprivate int
Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurementprivate int
Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurementprivate int
Exponent for the speed of light meters per second" conversion rate constantprivate int
Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurementprivate BigDecimal
private BigDecimal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
addPoweredEntity
(String poweredEntity) Adds Entity with power or not.applyPrefix
(MeasureUnit.MeasurePrefix unitPrefix) Apply SI or binary prefix to the Factor.protected UnitsConverter.Factor
copy()
Copy thisFactor
.divide
(UnitsConverter.Factor other) divide
(BigDecimal value) Returns a singleBigDecimal
that represent the conversion rate after substituting all the constants.multiply
(UnitsConverter.Factor other) private void
multiply
(BigDecimal value, int power) Multiplies the Factor instance by value^power.power
(int power) static UnitsConverter.Factor
processFactor
(String factor) private static UnitsConverter.Factor
processFactorWithoutDivision
(String factorWithoutDivision)
-
Field Details
-
factorNum
-
factorDen
-
exponentFtToM
private int exponentFtToMExponent for the ft_to_m constant -
exponentPi
private int exponentPiExponent for PI -
exponentGravity
private int exponentGravityExponent for gravity (gravity-of-earth, "g") -
exponentG
private int exponentGExponent for Newtonian constant of gravitation "G". -
exponentGalImpToM3
private int exponentGalImpToM3Exponent for the imperial-gallon to cubic-meter conversion rate constant -
exponentLbToKg
private int exponentLbToKgExponent for the pound to kilogram conversion rate constant -
exponentGlucoseMolarMass
private int exponentGlucoseMolarMassExponent for the glucose molar mass conversion rate constant -
exponentItemPerMole
private int exponentItemPerMoleExponent for the item per mole conversion rate constant -
exponentMetersPerAU
private int exponentMetersPerAUExponent for the meters per AU conversion rate constant -
exponentSecPerJulianYear
private int exponentSecPerJulianYearExponent for the sec per julian year conversion rate constant -
exponentSpeedOfLightMetersPerSecond
private int exponentSpeedOfLightMetersPerSecondExponent for the speed of light meters per second" conversion rate constant -
exponentShoToM3
private int exponentShoToM3Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement -
exponentTsuboToM2
private int exponentTsuboToM2Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement -
exponentShakuToM
private int exponentShakuToMExponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement -
exponentAMU
private int exponentAMUExponent for Atomic Mass Unit
-
-
Constructor Details
-
Factor
public Factor()Creates Empty Factor
-
-
Method Details
-
processFactor
-
processFactorWithoutDivision
-
copy
Copy thisFactor
. -
getConversionRate
Returns a singleBigDecimal
that represent the conversion rate after substituting all the constants. In ICU4C, see Factor::substituteConstants(). -
multiply
Multiplies the Factor instance by value^power. -
applyPrefix
Apply SI or binary prefix to the Factor. -
power
-
divide
-
multiply
-
divide
-
addPoweredEntity
Adds Entity with power or not. For example,12 ^ 3
or12
.- Parameters:
poweredEntity
-
-
addEntity
-