All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.roguewave.money.currency.v1_0.ExchangeGroup

public abstract interface ExchangeGroup
A currency exchange group is a collection of currencies that have a common distinguishing characteristic related to converting money from one currency to money of another currency. For example, the Euro currency exchange group, EuroGroup, consists of all of the currencies that will eventually be replaced by the Euro. All currencies in the Euro group use the same, special rule for converting money between currencies in this group.

ExchangeGroup is an interface which all currency groups implement. The purpose of an exchange group object is to take as input a source currency, target currency, and an exchange rate table, then produce an exchange object. Thus, the key component of the class ExchangeGroup is the abstract method:

 public abstract Exchange getExchange(String source, String target, ExchangeRateTable rates);
 

Money.h++ includes three currency exchange group implementation classes:

  • EuroGroup, which creates and returns a TriangularExchange object
  • MultiplicationGroup, which creates and returns a MultiplicationExchange object
  • DivisionGroup, which creates and returns a DivisionExchange object
  • Author:
    Trevor Misfeldt
    See Also:
    MultiplicationGroup, DivisionGroup, EuroGroup, Exchange, MultiplicationExchange, DivisionExchange, TriangularExchange, ExchangeRateTable, FactoryExample, GroupExample, MoneyCalculatorExample, USDollarGroup

    Method Index

     o getExchange(String, String, ExchangeRateTable)
    Returns an exchange object which can exchange source amounts to target amounts.
     o getName()
    Returns the name of this group.

    Methods

     o getName
     public abstract String getName()
    
    Returns the name of this group.

    Returns:
    the name
    See Also:
    NAME, NAME, NAME
     o getExchange
     public abstract Exchange getExchange(String source,
                                          String target,
                                          ExchangeRateTable rates)
    
    Returns an exchange object which can exchange source amounts to target amounts.

    Parameters:
    source - the original currency
    target - the desired currency
    rates - a table of exchange rates
    Returns:
    An exchange object which can convert values from the source currency to the target currency. If none could be found, a null value is returned.
    See Also:
    DivisionExchange, BilateralExchange, Exchange, getExchange, getExchange, getExchange

    All Packages  Class Hierarchy  This Package  Previous  Next  Index