public interface Unit<U extends Unit<U>>
extends java.io.Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
Unit.UnitMisMatchException
Exception class to support where any mathematical operation between two or more
Unit types is not supported.
|
Modifier and Type | Field and Description |
---|---|
static java.math.MathContext |
MATH_CONTEXT |
Modifier and Type | Method and Description |
---|---|
UnitValue<U> |
convert(UnitValue<U> otherValue)
Returns an instance of the UnitValue with this Unit converted according to a specific ratio
|
long |
getRatio(U u)
Deprecated.
|
UnitValue<U> |
valueOf(java.math.BigDecimal b)
Returns an instance of the UnitValue with this Unit and provided quantity
|
@Deprecated long getRatio(U u) throws Unit.UnitMisMatchException
u
- UnitUnit.UnitMisMatchException
- If ration cannot be obtained between two Units.UnitValue<U> valueOf(java.math.BigDecimal b)
b
- BigDecimal