|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.util.ExchangeRateCache
public class ExchangeRateCache
Cache of exchange rates. This class caches exchange rates in memory from the database. It is also responsible for importing the exchange rates, saving them into the database, loading them from database, and querying the user for exchange rates. It also provides helper functions to make performing cross-currency calculations easier.
Method Summary | |
---|---|
Money |
add(TradingDate date,
Money destinationMoney,
Money sourceMoney)
Add the two given monies. |
Money |
exchange(TradingDate date,
Money money,
Currency currency)
Exchange the given money for the given currency. |
static ExchangeRateCache |
getInstance()
Create or return the singleton instance of the exchange rate cache. |
double |
getRate(TradingDate date,
Currency sourceCurrency,
Currency destinationCurrency)
Return the exchange rate between the two currencies on the given date. |
void |
setDesktopPane(javax.swing.JDesktopPane desktopPane)
Inform the exchange rate cache of the desktop which will be used to display dialogs. |
Money |
subtract(TradingDate date,
Money destinationMoney,
Money sourceMoney)
Subtract the two given monies. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ExchangeRateCache getInstance()
public void setDesktopPane(javax.swing.JDesktopPane desktopPane)
desktopPane
- the desktop pane to usepublic double getRate(TradingDate date, Currency sourceCurrency, Currency destinationCurrency)
date
- the date for the exchangesourceCurrency
- the source currency to convert fromdestinationCurrency
- the destination currency to convert tothe
- rate to change the source currency into the destination currency.public Money add(TradingDate date, Money destinationMoney, Money sourceMoney)
date
- the date for the exchangedestinationMoney
- the "destination" money.sourceMoney
- the "source" money
public Money subtract(TradingDate date, Money destinationMoney, Money sourceMoney)
date
- the date for the exchangedestinationMoney
- the "destination" money.sourceMoney
- the "source" money
public Money exchange(TradingDate date, Money money, Currency currency)
date
- the date for the exchangemoney
- the money to convertcurrency
- the currency to convert to
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |