Package de.xima.fc.common.measure
Class QuantityBigDecimal<Unit extends MeasurementUnit<Unit>>
- java.lang.Object
-
- de.xima.fc.common.measure.QuantityBigDecimal<Unit>
-
- All Implemented Interfaces:
Quantity<Unit>
,Serializable
,Comparable<Quantity<Unit>>
public final class QuantityBigDecimal<Unit extends MeasurementUnit<Unit>> extends Object
AQuantity
that uses aBigDecimal
as its value.- Since:
- 8.4.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QuantityBigDecimal(BigDecimal value, Unit unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
bigDecimalValue()
The numerical value of the quantity, as aBigDecimal
.BigInteger
bigIntegerValue()
The numerical value of the quantity, as aBigInteger
.int
compareTo(Quantity<Unit> other)
Quantity<Unit>
convertTo(Unit unit)
Convert this quantity to the given unit.double
doubleValue()
The numerical value of the quantity, as aDouble
.boolean
equals(Object obj)
float
floatValue()
The numerical value of the quantity, as aFloat
.int
hashCode()
int
intValue()
The numerical value of the quantity, as anInteger
.long
longValue()
The numerical value of the quantity, as aLong
.String
toString()
Unit
unit()
The unit of the quantity.Number
value()
The numerical value of the quantity.
-
-
-
Constructor Detail
-
QuantityBigDecimal
public QuantityBigDecimal(BigDecimal value, Unit unit)
-
-
Method Detail
-
bigDecimalValue
public BigDecimal bigDecimalValue()
Description copied from interface:Quantity
The numerical value of the quantity, as aBigDecimal
.- Returns:
- The value of the quantity.
-
bigIntegerValue
public BigInteger bigIntegerValue()
Description copied from interface:Quantity
The numerical value of the quantity, as aBigInteger
.- Returns:
- The value of the quantity.
-
convertTo
public Quantity<Unit> convertTo(Unit unit)
Description copied from interface:Quantity
Convert this quantity to the given unit.- Parameters:
unit
- The unit to convert to.- Returns:
- The converted quantity.
-
doubleValue
public double doubleValue()
Description copied from interface:Quantity
The numerical value of the quantity, as aDouble
.- Returns:
- The value of the quantity.
-
floatValue
public float floatValue()
Description copied from interface:Quantity
The numerical value of the quantity, as aFloat
.- Returns:
- The value of the quantity.
-
intValue
public int intValue()
Description copied from interface:Quantity
The numerical value of the quantity, as anInteger
.- Returns:
- The value of the quantity.
-
longValue
public long longValue()
Description copied from interface:Quantity
The numerical value of the quantity, as aLong
.- Returns:
- The value of the quantity.
-
unit
public Unit unit()
Description copied from interface:Quantity
The unit of the quantity.- Returns:
- The unit of the quantity.
-
value
public Number value()
Description copied from interface:Quantity
The numerical value of the quantity.- Returns:
- The value of the quantity.
-
-