IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.bc.fx
Interface ForeignExchange

All Known Implementing Classes:
ForeignExchangeImpl

public interface ForeignExchange

Interfaces with the Foreign Exchange component, which is responsible for performing all foreign exchange calculations. It provides access to:


Method Summary
 java.math.BigDecimal convert(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem, java.math.BigDecimal fromAmount)
          Converts an amount in the source currency to another currency.
 java.math.BigDecimal convertReverse(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem, java.math.BigDecimal toAmount)
          Converts the source currency to the specified amount in the destination currency.
 java.lang.String[] getAllSupportedCurrencies()
          Returns all supported currency codes in a Set.
 java.math.BigDecimal getBuyRate(java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem)
          Returns the rate at which the financial institution buys the specified currency against the home currency.
 java.math.BigDecimal getBuyRate(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem)
          Returns the rate at which the financial institution buys the specified currency against the given source currency.
 java.lang.String[] getDefinedMonetaryItems()
          Returns all defined monetary item types.
 java.lang.String getHomeCurrency()
          Returns the home currency of financial institution.
 java.math.BigDecimal getSellRate(java.lang.String toCurrency, java.lang.String fromMoetaryItem, java.lang.String toMonetaryItem)
          Returns the rate at which the financial institution sells the specified currency against the home currency.
 java.math.BigDecimal getSellRate(java.lang.String fromCurrency, java.lang.String toCurrency, java.lang.String fromMonetaryItem, java.lang.String toMonetaryItem)
          Returns the rate at which the financial institution sells the specified currency against the source currency.
 

Method Detail

convert

java.math.BigDecimal convert(java.lang.String fromCurrency,
                             java.lang.String toCurrency,
                             java.lang.String fromMonetaryItem,
                             java.lang.String toMonetaryItem,
                             java.math.BigDecimal fromAmount)
                             throws ForeignExchangeException
Converts an amount in the source currency to another currency. If you want to specify the destination amount, use the convertReverse method.

Parameters:
fromCurrency - the String character code of the source currency
toCurrency - the String character code of the destination currency
fromMonetaryItem - the type of monetary item of the source currency
toMonetaryItem - the type of monetary item of the destination currency
fromAmount - the amount of money in the source currency
Returns:
the amount of money in the destination currency
Throws:
ForeignExchangeException - occurs if there is an error converting the currencies

convertReverse

java.math.BigDecimal convertReverse(java.lang.String fromCurrency,
                                    java.lang.String toCurrency,
                                    java.lang.String fromMonetaryItem,
                                    java.lang.String toMonetaryItem,
                                    java.math.BigDecimal toAmount)
                                    throws ForeignExchangeException
Converts the source currency to the specified amount in the destination currency. For example, use this method to convert an unknown amount of CAD to GBP 20.00. This method returns the amount of CAD required for the conversion. If you know the amount you want \ converted, use the convert method.

Parameters:
fromCurrency - the String character code of the source currency
toCurrency - the String character code of the destination currency
fromMonetaryItem - the type of monetary item of the source currency
toMonetaryItem - the type of monetary item of the destination currency
toAmount - the amount of money in the destination currency
Returns:
the amount of money in the source currency
Throws:
ForeignExchangeException - occurs if there is an error converting the currencies

getBuyRate

java.math.BigDecimal getBuyRate(java.lang.String toCurrency,
                                java.lang.String fromMonetaryItem,
                                java.lang.String toMonetaryItem)
                                throws ForeignExchangeException
Returns the rate at which the financial institution buys the specified currency against the home currency.

Parameters:
toCurrency - the String character code of the currency being bought
fromMonetaryItem - the type of monetary item of the source currency
toMonetaryItem - the type of monetary item of the destination currency
Returns:
the buy rate
Throws:
ForeignExchangeException - occurs if there is an error accessing the rates

getSellRate

java.math.BigDecimal getSellRate(java.lang.String toCurrency,
                                 java.lang.String fromMoetaryItem,
                                 java.lang.String toMonetaryItem)
                                 throws ForeignExchangeException
Returns the rate at which the financial institution sells the specified currency against the home currency.

Parameters:
toCurrency - the String character code of the destination currency
fromMoetaryItem - the type of monetary item of the source currency
toMonetaryItem - the type of monetary item of the destination currency
Returns:
the sell rate
Throws:
ForeignExchangeException - occurs if there is an error accessing the rates

getBuyRate

java.math.BigDecimal getBuyRate(java.lang.String fromCurrency,
                                java.lang.String toCurrency,
                                java.lang.String fromMonetaryItem,
                                java.lang.String toMonetaryItem)
                                throws ForeignExchangeException
Returns the rate at which the financial institution buys the specified currency against the given source currency.

Parameters:
fromCurrency - the String character code of the given source currency
toCurrency - the String character code of the currency being bought
fromMonetaryItem - the type of monetary item of the source currency
toMonetaryItem - the type of monetary item of the destination currency
Returns:
the buy rate
Throws:
ForeignExchangeException - occurs if there is an error accessing the rates

getSellRate

java.math.BigDecimal getSellRate(java.lang.String fromCurrency,
                                 java.lang.String toCurrency,
                                 java.lang.String fromMonetaryItem,
                                 java.lang.String toMonetaryItem)
                                 throws ForeignExchangeException
Returns the rate at which the financial institution sells the specified currency against the source currency.

Parameters:
fromCurrency - the String character code of the given source currency
toCurrency - the String character code of the destination currency
fromMonetaryItem - the type of monetary item of the source currency
toMonetaryItem - the type of monetary item of the destination currency
Returns:
the sell rate
Throws:
ForeignExchangeException - occurs if there is an error accessing the rates

getAllSupportedCurrencies

java.lang.String[] getAllSupportedCurrencies()
                                             throws ForeignExchangeException
Returns all supported currency codes in a Set.

Returns:
the Set containing all supported currency codes
Throws:
ForeignExchangeException - occurs if there is an error accessing the Set

getDefinedMonetaryItems

java.lang.String[] getDefinedMonetaryItems()
                                           throws ForeignExchangeException
Returns all defined monetary item types.

Returns:
the Set containing all supported monetary item types
Throws:
ForeignExchangeException - occurs if there is an error accessing the Set

getHomeCurrency

java.lang.String getHomeCurrency()
Returns the home currency of financial institution.

Returns:
the home currency of financial institution

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2010