All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.roguewave.examples.money.currency.v1_0.GroupExample
ExchangeFactory
and
exchange groups.
An instance of ExchangeFactory
contains an exchange rate table
and at at least one exchange group. Exchange groups can construct exchange
objects which are used to perform currency conversions. When presented with
a source/target currency pair the exchange factory searches its list of
exchange groups until it finds one that can create an exchange object given
the source/target pair and the factory's associated exchange rate table. If
no group can create such an object a null
value is returned by
the factory.
In this example an exchange factory object is created and three exchange groups are added. Several currency exchanges are performed.
public GroupExample()
public static void main(String args[])
java com.roguewave.examples.money.currency.v1_0.GroupExample
Output should appear as follows:
Factory Groups ============== 0 -- BilateralMultiplication 1 -- BilateralDivision 2 -- Euro Triangular 3 -- USDollarGroup Using exchange method: USDollar Method ARP 8976.80 = AUD 14223.35 Using exchange method: Triangular FRF 8976.80 = DEM 2678.93 Using exchange method: Bilateral Multiplication USD 8976.80 = DEM 14733.80
protected static Money doConversion(Money source, Exchange exchanger)
All Packages Class Hierarchy This Package Previous Next Index