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

Variable Index

 o factor

Constructor Index

 o BilateralExchange(ExchangeRate, String)
Constructs a bilateral exchange object with source currency, target currency and conversion factor provided by the ExchangeRate object.
 o BilateralExchange(String, String, double, String)
Constructs a bilateral exchange object with source currency mnemonic, target currency mnemonic and source to target conversion factor.

Method Index

 o getConversionFactor()
Returns the conversion factor.
 o getRate()
Returns the source, target and factor values in the form of an ExchangeRate.
 o setConversionFactor(double)
Sets the conversion factor.
 o setRate(ExchangeRate)
Sets the desired source, target and conversion factor through an ExchangeRate.

Variables

 o factor
 protected double factor

Constructors

 o 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
 o 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

Methods

 o setConversionFactor
 public void setConversionFactor(double factor)
Sets the conversion factor.

Parameters:
factor - the desired conversion factor
 o getConversionFactor
 public double getConversionFactor()
Returns the conversion factor.

Returns:
the current conversion factor
 o 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
 o 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