com.highdeal.currency
Class CurrencyMapBook

java.lang.Object
  extended by com.highdeal.currency.CurrencyMapBook
All Implemented Interfaces:
CurrencyBook

public class CurrencyMapBook
extends java.lang.Object
implements CurrencyBook

A CurrencyMapBook keeps the currencies that can be used in an application. Currencies are stored in a property resources.


Constructor Summary
CurrencyMapBook(java.util.Collection<Currency> currencies)
          Initializes a new property currency book from a currency list
 
Method Summary
 void addCurrency(Currency currency)
          Adds a currency in the currency book.
 java.util.Vector<Currency> getCurrencies()
          Returns all the current currencies that can be used in your client application.
 Currency getCurrency(int code)
          
Returns a currency from a given ISO 4217 code.
 Currency getCurrency(java.lang.String code)
          Returns a currency from a specified code.
 Currency getCurrency(java.lang.String iso4217code, int precision)
          Returns a currency from a given ISO 4217 code and with a precision greater or equal to the given precision; If there is no currency a given ISO 4217 code for with a precision greater or equal to the given precision, return null.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrencyMapBook

public CurrencyMapBook(java.util.Collection<Currency> currencies)
Initializes a new property currency book from a currency list

Parameters:
currencies - The currency list
Method Detail

addCurrency

public void addCurrency(Currency currency)
Description copied from interface: CurrencyBook
Adds a currency in the currency book.

Specified by:
addCurrency in interface CurrencyBook
Parameters:
currency - The currency to be added

getCurrencies

public java.util.Vector<Currency> getCurrencies()
Description copied from interface: CurrencyBook
Returns all the current currencies that can be used in your client application.

Specified by:
getCurrencies in interface CurrencyBook
Returns:
The current list of currencies that can be used in your client application

getCurrency

public Currency getCurrency(java.lang.String code)
Description copied from interface: CurrencyBook
Returns a currency from a specified code.

Specified by:
getCurrency in interface CurrencyBook
Parameters:
code - The code of the currency
Returns:
The currency for this code

getCurrency

public Currency getCurrency(java.lang.String iso4217code,
                            int precision)
Description copied from interface: CurrencyBook
Returns a currency from a given ISO 4217 code and with a precision greater or equal to the given precision; If there is no currency a given ISO 4217 code for with a precision greater or equal to the given precision, return null.

Specified by:
getCurrency in interface CurrencyBook
Parameters:
iso4217code - The ISO 4217 code of the currency
precision - The minimum precision of the currency
Returns:
The currency for this ISO 4217 code and precision or null

getCurrency

public Currency getCurrency(int code)
Description copied from interface: CurrencyBook
Returns a currency from a given ISO 4217 code.

Specified by:
getCurrency in interface CurrencyBook
Parameters:
code - The ISO 4217 three-digit currency code
Returns:
The currency for this code

size

public int size()

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)