public class CurrencyBookNotifier extends Object implements CurrencyBook
Java class represents a currency book notifier that keeps the currencies used in a client
application. A CurrencyBookNotifier is able to notify when a currency code is unknown.
After notify, the CurrencyBookNotifier return the currency after get code in currenciesBook.| Modifier and Type | Class and Description |
|---|---|
static interface |
CurrencyBookNotifier.ICurrencyBookNotifier
This
Java interface defines the methods that can be implemented to customize the behavior of your application. |
| Constructor and Description |
|---|
CurrencyBookNotifier(CurrencyBook currenciesBook,
CurrencyBookNotifier.ICurrencyBookNotifier notifier)
Initializes a new property currency notifier with a currency book and a notifier
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCurrency(Currency currency)
Adds a currency in the currency book.
|
void |
doNotification() |
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(String code)
Returns a currency from a specified code.
|
Currency |
getCurrency(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.
|
public CurrencyBookNotifier(CurrencyBook currenciesBook, CurrencyBookNotifier.ICurrencyBookNotifier notifier)
currenciesBook - The currency listnotifier - The currency book notifierpublic void addCurrency(Currency currency)
CurrencyBookaddCurrency in interface CurrencyBookcurrency - The currency to be addedpublic Vector<Currency> getCurrencies()
CurrencyBookgetCurrencies in interface CurrencyBookpublic Currency getCurrency(int code)
CurrencyBookgetCurrency in interface CurrencyBookcode - The ISO 4217 three-digit currency codepublic Currency getCurrency(String code)
CurrencyBookgetCurrency in interface CurrencyBookcode - The code of the currencypublic Currency getCurrency(String iso4217code, int precision)
CurrencyBookgetCurrency in interface CurrencyBookiso4217code - The ISO 4217 code of the currencyprecision - The minimum precision of the currencypublic void doNotification()