public class MonetaryAmount extends UnitAmount
Constructor and Description |
---|
MonetaryAmount(java.math.BigDecimal aValue,
java.lang.String aCurrency)
MonetaryAmount constructor.
|
Modifier and Type | Method and Description |
---|---|
MonetaryAmount |
add(MonetaryAmount aMonetaryAmount)
Add 2 monetary amounts.
|
MonetaryAmount |
divide(java.math.BigDecimal aBigDecimal)
Divide a monetary amount by a big decimal.
|
java.lang.String |
getCurrency()
Get the currency of the monetary amount.
|
java.math.BigDecimal |
getValue()
Get the value of the monetary amount.
|
MonetaryAmount |
multiply(java.math.BigDecimal aBigDecimal)
Multiply a monetary amount by a big decimal value.
|
void |
setValue(java.math.BigDecimal aValue)
Set the value of the monetary amount.
|
MonetaryAmount |
subtract(MonetaryAmount aMonetaryAmount)
Subtract 2 monetary amounts.
|
toString
public MonetaryAmount(java.math.BigDecimal aValue, java.lang.String aCurrency)
aValue
- monetary value.aCurrency
- currency.public MonetaryAmount add(MonetaryAmount aMonetaryAmount)
aMonetaryAmount
- the monetary amount to add to this one.public MonetaryAmount divide(java.math.BigDecimal aBigDecimal)
aBigDecimal
- the value to divide into this one.public java.lang.String getCurrency()
public java.math.BigDecimal getValue()
public MonetaryAmount multiply(java.math.BigDecimal aBigDecimal)
aBigDecimal
- the value to multiply to this one.public void setValue(java.math.BigDecimal aValue)
aValue
- the value.public MonetaryAmount subtract(MonetaryAmount aMonetaryAmount)
aMonetaryAmount
- the monetary amount to subtract from this one.