| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static enum | |
| pack-priv static class | UnitsConverter.Factor
Responsible for all the Factor operation NOTE: This class is immutable |
| Modifier and Type | Field and Description |
|---|---|
| private BigDecimal | |
| private BigDecimal | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | UnitsConverter(String
represents the source unit identifier. sourceIdentifier, String represents the target unit identifier. targetIdentifier)Constructor of |
| public | UnitsConverter(MeasureUnitImpl
represents the source unit. source, MeasureUnitImpl represents the target unit. target, ConversionRates contains all the needed conversion rates. conversionRates)Constructor of |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| public BigDecimal | |
| public BigDecimal | |
| public static UnitsConverter. | extractConvertibility(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates)
|
| public UnitsConverter. | |
| private static void | insertInMap(HashMap<String, Integer> dimensionMap, ArrayList<SingleUnitImpl> singleUnits, int multiplier)
Helpers |
| public String |
| conversionRate | back to summary |
|---|---|
| private BigDecimal conversionRate | |
| offset | back to summary |
|---|---|
| private BigDecimal offset | |
| reciprocal | back to summary |
|---|---|
| private boolean reciprocal | |
| UnitsConverter | back to summary |
|---|---|
| public UnitsConverter(String sourceIdentifier, String targetIdentifier) Constructor of 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 | back to summary |
|---|---|
| public UnitsConverter(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates) Constructor of Note - source and target must be under the same category - e.g. meter to mile --> both of them are length units.
| |
| areDimensionsZeroes | back to summary |
|---|---|
| private static boolean areDimensionsZeroes(HashMap<String, Integer> dimensionMap) | |
| convert | back to summary |
|---|---|
| public BigDecimal convert(BigDecimal inputValue) | |
| convertInverse | back to summary |
|---|---|
| public BigDecimal convertInverse(BigDecimal inputValue) | |
| extractConvertibility | back to summary |
|---|---|
| public static UnitsConverter. | |
| getConversionInfo | back to summary |
|---|---|
| public UnitsConverter. | |
| insertInMap | back to summary |
|---|---|
| private static void insertInMap(HashMap<String, Integer> dimensionMap, ArrayList<SingleUnitImpl> singleUnits, int multiplier) Helpers | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public BigDecimal | |
| public BigDecimal | |
| public boolean |
| Access | Constructor and Description |
|---|---|
| public |
| conversionRate | back to summary |
|---|---|
| public BigDecimal conversionRate | |
| offset | back to summary |
|---|---|
| public BigDecimal offset | |
| reciprocal | back to summary |
|---|---|
| public boolean reciprocal | |
| ConversionInfo | back to summary |
|---|---|
| public ConversionInfo() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final UnitsConverter. | |
| public static final UnitsConverter. | |
| public static final UnitsConverter. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static UnitsConverter. | |
| public static UnitsConverter. |
| CONVERTIBLE | back to summary |
|---|---|
| public static final UnitsConverter. | |
| RECIPROCAL | back to summary |
|---|---|
| public static final UnitsConverter. | |
| UNCONVERTIBLE | back to summary |
|---|---|
| public static final UnitsConverter. | |
| Convertibility | back to summary |
|---|---|
| private Convertibility() | |
| valueOf | back to summary |
|---|---|
| public static UnitsConverter. | |
| values | back to summary |
|---|---|
| public static UnitsConverter. | |
| Modifier and Type | Field and Description |
|---|---|
| private int | exponentAMU
Exponent for Atomic Mass Unit |
| private int | exponentFtToM
Exponent for the ft_to_m constant |
| private int | exponentG
Exponent for Newtonian constant of gravitation "G". |
| private int | exponentGalImpToM3
Exponent for the imperial-gallon to cubic-meter conversion rate constant |
| private int | exponentGlucoseMolarMass
Exponent for the glucose molar mass conversion rate constant |
| private int | exponentGravity
Exponent for gravity (gravity-of-earth, "g") |
| private int | exponentItemPerMole
Exponent for the item per mole conversion rate constant |
| private int | exponentLbToKg
Exponent for the pound to kilogram conversion rate constant |
| private int | exponentMetersPerAU
Exponent for the meters per AU conversion rate constant |
| private int | exponentPi
Exponent for PI |
| private int | exponentSecPerJulianYear
Exponent for the sec per julian year conversion rate constant |
| private int | exponentShakuToM
Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement |
| private int | exponentShoToM3
Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement |
| private int | exponentSpeedOfLightMetersPerSecond
Exponent for the speed of light meters per second" conversion rate constant |
| private int | exponentTsuboToM2
Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement |
| private BigDecimal | |
| private BigDecimal |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public UnitsConverter. | |
| protected UnitsConverter. | |
| public UnitsConverter. | |
| public BigDecimal | getConversionRate()
Returns a single |
| private void | |
| public UnitsConverter. | |
| public UnitsConverter. | |
| public static UnitsConverter. | |
| private static UnitsConverter. |
| exponentAMU | back to summary |
|---|---|
| private int exponentAMU Exponent for Atomic Mass Unit | |
| exponentFtToM | back to summary |
|---|---|
| private int exponentFtToM Exponent for the ft_to_m constant | |
| exponentG | back to summary |
|---|---|
| private int exponentG Exponent for Newtonian constant of gravitation "G". | |
| exponentGalImpToM3 | back to summary |
|---|---|
| private int exponentGalImpToM3 Exponent for the imperial-gallon to cubic-meter conversion rate constant | |
| exponentGlucoseMolarMass | back to summary |
|---|---|
| private int exponentGlucoseMolarMass Exponent for the glucose molar mass conversion rate constant | |
| exponentGravity | back to summary |
|---|---|
| private int exponentGravity Exponent for gravity (gravity-of-earth, "g") | |
| exponentItemPerMole | back to summary |
|---|---|
| private int exponentItemPerMole Exponent for the item per mole conversion rate constant | |
| exponentLbToKg | back to summary |
|---|---|
| private int exponentLbToKg Exponent for the pound to kilogram conversion rate constant | |
| exponentMetersPerAU | back to summary |
|---|---|
| private int exponentMetersPerAU Exponent for the meters per AU conversion rate constant | |
| exponentPi | back to summary |
|---|---|
| private int exponentPi Exponent for PI | |
| exponentSecPerJulianYear | back to summary |
|---|---|
| private int exponentSecPerJulianYear Exponent for the sec per julian year conversion rate constant | |
| exponentShakuToM | back to summary |
|---|---|
| private int exponentShakuToM Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement | |
| exponentShoToM3 | back to summary |
|---|---|
| private int exponentShoToM3 Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement | |
| exponentSpeedOfLightMetersPerSecond | back to summary |
|---|---|
| private int exponentSpeedOfLightMetersPerSecond Exponent for the speed of light meters per second" conversion rate constant | |
| exponentTsuboToM2 | back to summary |
|---|---|
| private int exponentTsuboToM2 Exponent for https://en.wikipedia.org/wiki/Japanese_units_of_measurement | |
| factorDen | back to summary |
|---|---|
| private BigDecimal factorDen | |
| factorNum | back to summary |
|---|---|
| private BigDecimal factorNum | |
| Factor | back to summary |
|---|---|
| public Factor() Creates Empty Factor | |
| addEntity | back to summary |
|---|---|
| private void addEntity(String entity, int power) | |
| addPoweredEntity | back to summary |
|---|---|
| private void addPoweredEntity(String poweredEntity) Adds Entity with power or not. For example, | |
| applyPrefix | back to summary |
|---|---|
| public UnitsConverter. Apply SI or binary prefix to the Factor. | |
| copy | back to summary |
|---|---|
| protected UnitsConverter. Copy this | |
| divide | back to summary |
|---|---|
| public UnitsConverter. | |
| getConversionRate | back to summary |
|---|---|
| public BigDecimal getConversionRate() Returns a single | |
| multiply | back to summary |
|---|---|
| private void multiply(BigDecimal value, int power) Multiplies the Factor instance by value^power. | |
| multiply | back to summary |
|---|---|
| public UnitsConverter. | |
| power | back to summary |
|---|---|
| public UnitsConverter. | |
| processFactor | back to summary |
|---|---|
| public static UnitsConverter. | |
| processFactorWithoutDivision | back to summary |
|---|---|
| private static UnitsConverter. | |