|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.price.utils.UnitAmount | +--com.ibm.commerce.price.utils.MonetaryAmount
A monetary amount.
Constructor Summary | |
MonetaryAmount(java.math.BigDecimal aValue,
java.lang.String aCurrency)
MonetaryAmount constructor. |
Method Summary | |
MonetaryAmount |
add(MonetaryAmount aMonetaryAmount)
Add 2 monetary amounts. |
protected UnitAmount |
createNewUnitAmount(java.lang.Object aValue,
java.lang.String aUnit)
Create a new monetary amount from the parameters. |
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. |
Methods inherited from class com.ibm.commerce.price.utils.UnitAmount |
getUnit, getValueI, setUnit, setValue, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MonetaryAmount(java.math.BigDecimal aValue, java.lang.String aCurrency)
aValue
- monetary value.aCurrency
- currency.Method Detail |
public MonetaryAmount add(MonetaryAmount aMonetaryAmount)
aMonetaryAmount
- the monetary amount to add to this one.protected UnitAmount createNewUnitAmount(java.lang.Object aValue, java.lang.String aUnit)
createNewUnitAmount
in class UnitAmount
aValue
- The value of the amount.aUnit
- The currency of the amount.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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |