public class CurrencyMapBook extends java.lang.Object implements CurrencyBook
CurrencyMapBook keeps the currencies that can be used in an
application. Currencies are stored in a property resources.| Constructor and Description |
|---|
CurrencyMapBook(java.util.Collection<Currency> currencies)
Initializes a new property currency book from a currency list
|
| Modifier and Type | Method and Description |
|---|---|
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() |
public CurrencyMapBook(java.util.Collection<Currency> currencies)
currencies - The currency listpublic void addCurrency(Currency currency)
CurrencyBookaddCurrency in interface CurrencyBookcurrency - The currency to be addedpublic java.util.Vector<Currency> getCurrencies()
CurrencyBookgetCurrencies in interface CurrencyBookpublic Currency getCurrency(java.lang.String code)
CurrencyBookgetCurrency in interface CurrencyBookcode - The code of the currencypublic Currency getCurrency(java.lang.String iso4217code, int precision)
CurrencyBookgetCurrency in interface CurrencyBookiso4217code - The ISO 4217 code of the currencyprecision - The minimum precision of the currencypublic Currency getCurrency(int code)
CurrencyBookgetCurrency in interface CurrencyBookcode - The ISO 4217 three-digit currency codepublic int size()