Package com.highdeal.currency
Class CurrencyBookNotifier
java.lang.Object
com.highdeal.currency.CurrencyBookNotifier
- All Implemented Interfaces:
CurrencyBook
This
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThisJava interfacedefines the methods that can be implemented to customize the behavior of your application. -
Constructor Summary
ConstructorsConstructorDescriptionCurrencyBookNotifier(CurrencyBook currenciesBook, CurrencyBookNotifier.ICurrencyBookNotifier notifier) Initializes a new property currency notifier with a currency book and a notifier -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCurrency(Currency currency) Adds a currency in the currency book.voidReturns all the current currencies that can be used in your client application.getCurrency(int code) Returns a currency from a given ISO 4217 code.getCurrency(String code) Returns a currency from a specified code.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.
-
Constructor Details
-
CurrencyBookNotifier
public CurrencyBookNotifier(CurrencyBook currenciesBook, CurrencyBookNotifier.ICurrencyBookNotifier notifier) Initializes a new property currency notifier with a currency book and a notifier- Parameters:
currenciesBook- The currency listnotifier- The currency book notifier
-
-
Method Details
-
addCurrency
Description copied from interface:CurrencyBookAdds a currency in the currency book.- Specified by:
addCurrencyin interfaceCurrencyBook- Parameters:
currency- The currency to be added
-
getCurrencies
Description copied from interface:CurrencyBookReturns all the current currencies that can be used in your client application.- Specified by:
getCurrenciesin interfaceCurrencyBook- Returns:
- The current list of currencies that can be used in your client application
-
getCurrency
Description copied from interface:CurrencyBookReturns a currency from a given ISO 4217 code.- Specified by:
getCurrencyin interfaceCurrencyBook- Parameters:
code- The ISO 4217 three-digit currency code- Returns:
- The currency for this code
-
getCurrency
Description copied from interface:CurrencyBookReturns a currency from a specified code.- Specified by:
getCurrencyin interfaceCurrencyBook- Parameters:
code- The code of the currency- Returns:
- The currency for this code
-
getCurrency
Description copied from interface:CurrencyBookReturns 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:
getCurrencyin interfaceCurrencyBook- Parameters:
iso4217code- The ISO 4217 code of the currencyprecision- The minimum precision of the currency- Returns:
- The currency for this ISO 4217 code and precision or null
-
doNotification
public void doNotification()
-