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