Class CurrencyBookNotifier

java.lang.Object
com.highdeal.currency.CurrencyBookNotifier
All Implemented Interfaces:
CurrencyBook

public class CurrencyBookNotifier extends Object implements 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.
  • 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 list
      notifier - The currency book notifier
  • Method Details

    • 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 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(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
    • getCurrency

      public Currency getCurrency(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(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
    • doNotification

      public void doNotification()