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
A Quantity that uses a BigDecimal as its value.
Since:
8.4.0
See Also:
  • Constructor Details

    • QuantityBigDecimal

      public QuantityBigDecimal(BigDecimal value, Unit unit)
  • Method Details

    • bigDecimalValue

      public BigDecimal bigDecimalValue()
      Description copied from interface: Quantity
      The numerical value of the quantity, as a BigDecimal.
      Returns:
      The value of the quantity.
    • bigIntegerValue

      public BigInteger bigIntegerValue()
      Description copied from interface: Quantity
      The numerical value of the quantity, as a BigInteger.
      Returns:
      The value of the quantity.
    • compareTo

      public int compareTo(Quantity<Unit> other)
    • 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 a Double.
      Returns:
      The value of the quantity.
    • floatValue

      public float floatValue()
      Description copied from interface: Quantity
      The numerical value of the quantity, as a Float.
      Returns:
      The value of the quantity.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • intValue

      public int intValue()
      Description copied from interface: Quantity
      The numerical value of the quantity, as an Integer.
      Returns:
      The value of the quantity.
    • longValue

      public long longValue()
      Description copied from interface: Quantity
      The numerical value of the quantity, as a Long.
      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.
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object