Class Money
java.lang.Object
org.episteme.social.economics.money.Money
- All Implemented Interfaces:
Serializable, Quantity<Money>
Represents a quantity of money with currency.
Implements Quantity<Money> to allow integration with the measurement system.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()Returns the absolute value of this quantity.Adds another quantity to this one.intCompares this quantity with another for order.divide(double scalar) Divides this quantity by a scalar value.Divides this quantity by a scalar value.Divides this quantity by another quantity.booleanbooleanChecks if this quantity equals another within tolerance.static Moneyeur(double amount) static MoneygetUnit()Returns the unit of measurement for this quantity.getValue()Returns the numerical value of this quantity in its current unit.inthashCode()multiply(double scalar) Multiplies this quantity by a scalar value.Multiplies this quantity by a scalar value.Multiplies this quantity by another quantity.negate()Returns the negation of this quantity.Quantity<?> pow(int exponent) Returns this quantity raised to the specified exponent.Quantity<?> sqrt()Returns the square root of this quantity.Subtracts another quantity from this one.Converts this quantity to the specified unit.toString()static Moneyusd(double amount) static Moneystatic Moneystatic MoneyMethods inherited from interface Quantity
asType, getValue, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo, isZero
-
Field Details
-
DIMENSION
-
BASE_UNIT
-
-
Constructor Details
-
Money
-
Money
-
-
Method Details
-
getValue
-
getUnit
-
to
Description copied from interface:QuantityConverts this quantity to the specified unit.Returns a new quantity with the same physical magnitude but expressed in the target unit.
-
add
Description copied from interface:QuantityAdds another quantity to this one.If the units differ, the other quantity is converted to this quantity's unit before addition.
-
subtract
Description copied from interface:QuantitySubtracts another quantity from this one.If the units differ, the other quantity is converted to this quantity's unit before subtraction.
-
add
-
subtract
-
multiply
-
multiply
-
multiply
Description copied from interface:QuantityMultiplies this quantity by another quantity.The result's unit is the product of the two units. For example, multiplying Length by Length gives Area.
-
divide
-
divide
-
divide
Description copied from interface:QuantityDivides this quantity by another quantity.The result's unit is the quotient of the two units. For example, dividing Length by Time gives Velocity.
-
abs
-
negate
-
compareTo
Description copied from interface:QuantityCompares this quantity with another for order. Both quantities are compared in this quantity's unit. -
equals
Description copied from interface:QuantityChecks if this quantity equals another within tolerance. -
equals
-
hashCode
-
pow
-
sqrt
-
getAmount
-
getCurrency
-
toString
-
valueOf
-
valueOf
-
usd
-
usd
-
eur
-
eur
-