All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.money.currency.v1_0.MultiplicationExchange

java.lang.Object
   |
   +----com.roguewave.money.currency.v1_0.Exchange
           |
           +----com.roguewave.money.currency.v1_0.BilateralExchange
                   |
                   +----com.roguewave.money.currency.v1_0.MultiplicationExchange

public class MultiplicationExchange
extends BilateralExchange
The MultiplicationExchange derives from the abstract base class BilateralExchange. A MultiplicationExchange object converts a source currency to a target currency by multiplying the amount of the source currency by the associated conversion factor to obtain the target currency. This contrasts with DivisionExchange which divides its source currency by the conversion factor to obtain the target amount.

Author:
Trevor Misfeldt
See Also:
BilateralExchange, Exchange, DivisionExchange, FactoryExample, GroupExample

Variable Index

 o NAME
The name of this method of conversion is "Bilateral Multiplication"

Constructor Index

 o MultiplicationExchange(ExchangeRate)
Creates a new exchange object with the source, target and factor taken from the exchange rate.
 o MultiplicationExchange(String, String, double)
Creates a new exchange object with the desired source, target and conversion factor.

Method Index

 o exchange(Money)
Exchanges the money to the target currency.

Variables

 o NAME
 public static final String NAME
The name of this method of conversion is "Bilateral Multiplication"

Constructors

 o MultiplicationExchange
 public MultiplicationExchange(ExchangeRate rate)
Creates a new exchange object with the source, target and factor taken from the exchange rate.

Parameters:
the - exchange rate to use for conversion
 o MultiplicationExchange
 public MultiplicationExchange(String source,
                               String target,
                               double factor)
Creates a new exchange object with the desired source, target and conversion factor.

Parameters:
source - the currency to convert
target - the desired currency
factor - the factor to multiply the source amount by to get a target amount

Methods

 o exchange
 public Money exchange(Money money)
Exchanges the money to the target currency. Calls the error handler if money's currency is not equal to the source currency.

Parameters:
money - the money before conversion
Returns:
Money in the target currency with a converted value.
Overrides:
exchange in class Exchange

All Packages  Class Hierarchy  This Package  Previous  Next  Index