All Packages Class Hierarchy This Package Previous Next Index
Class com.roguewave.money.currency.v1_0.BilateralExchange
java.lang.Object
|
+----com.roguewave.money.currency.v1_0.Exchange
|
+----com.roguewave.money.currency.v1_0.BilateralExchange
- public abstract class BilateralExchange
- extends Exchange
BilateralExchange
is an abstract base class derived from the
base class Exchange
. It is the parent of both the
MultiplicationExchange
and DivisionExchange
classes.
BilateralExchange
implements the usual method of currency
conversion: Multiplying or dividing the amount of a source currency by a
conversion factor to obtain the equivalent amount in the target currency.
- Author:
- Trevor Misfeldt
- See Also:
- Exchange, MultiplicationExchange, DivisionExchange
-
factor
-
-
BilateralExchange(ExchangeRate, String)
- Constructs a bilateral exchange object with source currency, target currency and
conversion factor provided by the
ExchangeRate
object.
-
BilateralExchange(String, String, double, String)
- Constructs a bilateral exchange object with source currency mnemonic, target
currency mnemonic and source to target conversion factor.
-
getConversionFactor()
- Returns the conversion factor.
-
getRate()
- Returns the source, target and factor values in the form of an
ExchangeRate
.
-
setConversionFactor(double)
- Sets the conversion factor.
-
setRate(ExchangeRate)
- Sets the desired source, target and conversion factor through an
ExchangeRate
.
factor
protected double factor
BilateralExchange
protected BilateralExchange(ExchangeRate rate,
String name)
- Constructs a bilateral exchange object with source currency, target currency and
conversion factor provided by the
ExchangeRate
object.
- Parameters:
- rate - The ExchangeRate to use for the bilateral conversion.
- name - The name of the conversion method.
- See Also:
- ExchangeRate
BilateralExchange
protected BilateralExchange(String source,
String target,
double factor,
String name)
- Constructs a bilateral exchange object with source currency mnemonic, target
currency mnemonic and source to target conversion factor.
- Parameters:
- source - The mnemonic for the conversion source currency.
- target - The mnemonic for the conversion target currency.
- factor - The value to multiply/divide the source amount by to get the target amount.
- name - The name of the conversion method used.
- See Also:
- getMnemonic
setConversionFactor
public void setConversionFactor(double factor)
- Sets the conversion factor.
- Parameters:
- factor - the desired conversion factor
getConversionFactor
public double getConversionFactor()
- Returns the conversion factor.
- Returns:
- the current conversion factor
getRate
public ExchangeRate getRate()
- Returns the source, target and factor values in the form of an
ExchangeRate
.
- Returns:
- the exchange rate used during conversion
- See Also:
- ExchangeRate
setRate
public void setRate(ExchangeRate rate)
- Sets the desired source, target and conversion factor through an
ExchangeRate
.
- Parameters:
- rate - the desired exchange rate
All Packages Class Hierarchy This Package Previous Next Index