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 intExponent for Atomic Mass Unitprivate intExponent for the ft_to_m constantprivate intExponent for Newtonian constant of gravitation "G".private intExponent for the imperial-gallon to cubic-meter conversion rate constantprivate intExponent for the glucose molar mass conversion rate constantprivate intExponent for gravity (gravity-of-earth, "g")private intExponent for the item per mole conversion rate constantprivate intExponent for the pound to kilogram conversion rate constantprivate intExponent for the meters per AU conversion rate constantprivate intExponent for PIprivate intExponent for the sec per julian year conversion rate constantprivate intExponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurementprivate intExponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurementprivate intExponent for the speed of light meters per second" conversion rate constantprivate intExponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurementprivate BigDecimalprivate BigDecimal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidaddPoweredEntity(String poweredEntity) Adds Entity with power or not.applyPrefix(MeasureUnit.MeasurePrefix unitPrefix) Apply SI or binary prefix to the Factor.protected UnitsConverter.Factorcopy()Copy thisFactor.divide(UnitsConverter.Factor other) Returns a singleBigDecimalthat represent the conversion rate after substituting all the constants.multiply(UnitsConverter.Factor other) private voidmultiply(BigDecimal value, int power) Multiplies the Factor instance by value^power.power(int power) static UnitsConverter.FactorprocessFactor(String factor) private static UnitsConverter.FactorprocessFactorWithoutDivision(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 singleBigDecimalthat 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
-
addPoweredEntity
Adds Entity with power or not. For example,12 ^ 3or12.- Parameters:
poweredEntity-
-
addEntity
-