|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Money
Represents an amount of money in a particular currency.
| Method Summary | |
|---|---|
Money |
add(Money otherMoney)
Returns a new Money object representing the sum of this object and otherMoney's values. |
java.lang.String |
displaySalePercentage(Money salePrice,
java.util.Locale locale)
Creates a string to display the percentage savings at the specified sale price. |
java.lang.String |
displaySaleSavings(Money salePrice)
Creates a string to display the amount saved at the specified sale price. |
java.math.BigDecimal |
getAmount()
Get the amount of money as a BigDecimal. |
java.util.Currency |
getCurrency()
Get the Currency of the money. |
java.lang.String |
getMoneyValueAndSymbol()
Prints the symbol of the selected currency along with the value. |
boolean |
greaterThan(Money otherMoney)
Returns true if this money object is greater than the specified other money object. |
boolean |
lessThan(Money otherMoney)
Returns true if this money object is less than the specified other money object. |
Money |
multiply(java.math.BigDecimal multiplier)
Return a new Money object whose value is this money object's value times the specified multiplier. |
Money |
multiply(int multiplier)
Return a new Money object whose value is this money object's value times the specified multiplier. |
void |
setCurrency(java.util.Currency currency)
Set the Currency of the money. |
void |
setValue(java.math.BigDecimal amount,
java.util.Currency currency)
Set the value that this object represents. |
void |
setValue(float amount,
java.util.Currency currency)
Set the value that this object represents. |
Money |
subtract(Money otherMoney)
Returns a new Money object representing the the amount of this object less the amount of the otherMoney object. |
| Methods inherited from interface com.elasticpath.domain.EpDomain |
|---|
getElasticPath, setElasticPath |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Method Detail |
|---|
Money add(Money otherMoney)
Money object representing the sum of this object and otherMoney's values.
otherMoney - the Money object whose value is to be added to this object
Money object representing the sum.
java.lang.String displaySalePercentage(Money salePrice,
java.util.Locale locale)
salePrice - the sale pricelocale - the user's locale
java.lang.String displaySaleSavings(Money salePrice)
salePrice - the sale price
java.math.BigDecimal getAmount()
BigDecimal.
BigDecimal amountjava.util.Currency getCurrency()
Currency of the money.
Currencyjava.lang.String getMoneyValueAndSymbol()
boolean greaterThan(Money otherMoney)
otherMoney - the other money object
boolean lessThan(Money otherMoney)
otherMoney - the other money object
Money multiply(java.math.BigDecimal multiplier)
multiplier - the amount to multiply by
Money multiply(int multiplier)
multiplier - the amount to multiply by
void setCurrency(java.util.Currency currency)
Currency of the money.
currency - the Currency
void setValue(java.math.BigDecimal amount,
java.util.Currency currency)
amount - the amount of money as a BigDecimalcurrency - the money's currency
void setValue(float amount,
java.util.Currency currency)
amount - the amount of money as a floatcurrency - the money's currencyMoney subtract(Money otherMoney)
Money object representing the the amount of this object less the amount of the otherMoney object.
otherMoney - the Money object whose value is to be subtracted from this object
Money object representing this value less the other object's value.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||