Package de.xima.fc.common.measure
Class QuantityDouble<Unit extends MeasurementUnit<Unit>>
- java.lang.Object
-
- de.xima.fc.common.measure.QuantityDouble<Unit>
-
- All Implemented Interfaces:
Quantity<Unit>,Serializable,Comparable<Quantity<Unit>>
public final class QuantityDouble<Unit extends MeasurementUnit<Unit>> extends Object
AQuantitythat uses adoubleas its value.- Since:
- 8.4.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QuantityDouble(double value, Unit unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimalbigDecimalValue()The numerical value of the quantity, as aBigDecimal.BigIntegerbigIntegerValue()The numerical value of the quantity, as aBigInteger.intcompareTo(Quantity<Unit> other)Quantity<Unit>convertTo(Unit unit)Convert this quantity to the given unit.doubledoubleValue()The numerical value of the quantity, as aDouble.booleanequals(Object obj)floatfloatValue()The numerical value of the quantity, as aFloat.inthashCode()intintValue()The numerical value of the quantity, as anInteger.longlongValue()The numerical value of the quantity, as aLong.StringtoString()Unitunit()The unit of the quantity.Numbervalue()The numerical value of the quantity.
-
-
-
Constructor Detail
-
QuantityDouble
public QuantityDouble(double value, Unit unit)
-
-
Method Detail
-
bigDecimalValue
public BigDecimal bigDecimalValue()
Description copied from interface:QuantityThe numerical value of the quantity, as aBigDecimal.- Returns:
- The value of the quantity.
-
bigIntegerValue
public BigInteger bigIntegerValue()
Description copied from interface:QuantityThe numerical value of the quantity, as aBigInteger.- Returns:
- The value of the quantity.
-
convertTo
public Quantity<Unit> convertTo(Unit unit)
Description copied from interface:QuantityConvert 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:QuantityThe numerical value of the quantity, as aDouble.- Returns:
- The value of the quantity.
-
floatValue
public float floatValue()
Description copied from interface:QuantityThe numerical value of the quantity, as aFloat.- Returns:
- The value of the quantity.
-
intValue
public int intValue()
Description copied from interface:QuantityThe numerical value of the quantity, as anInteger.- Returns:
- The value of the quantity.
-
longValue
public long longValue()
Description copied from interface:QuantityThe numerical value of the quantity, as aLong.- Returns:
- The value of the quantity.
-
unit
public Unit unit()
Description copied from interface:QuantityThe unit of the quantity.- Returns:
- The unit of the quantity.
-
value
public Number value()
Description copied from interface:QuantityThe numerical value of the quantity.- Returns:
- The value of the quantity.
-
-