Documentation of 'org.jquantlib.currencies.ExchangeRateManager' Java class
ExchangeRateManager
org.jquantlib.currencies

Class ExchangeRateManager



  • public class ExchangeRateManager
    extends java.lang.Object
    Exchange rate Repository.
    • Method Detail

      • getInstance

        public static ExchangeRateManager getInstance()
        Returns a singleton of the ExchangeRateManager.
        Returns:
        The ExchangeRateManager shared by everything loaded with this classloader.
      • add

        public void add(ExchangeRate rate,
                        Date startDate,
                        Date endDate)
        Adds an exchange rate. The given rate is valid between the given dates. Note: If two rates are given between the same currencies and with overlapping date ranges, the latest one added takes precedence during lookup.
        Parameters:
        rate - The ExchangeRate to be added
        startDate - The start date of the period for which the above Exchange rate should be valid.
        endDate - The end date of the period for which the above Exchange rate should be valid.
      • add

        public void add(ExchangeRate rate)
        Adds an exchange rate to the repository. The given rate is valid between min and max Date (implementation dependend).
        Parameters:
        rate -
      • lookup

        public ExchangeRate lookup(Currency source,
                                   Currency target)
        Looks up an ExchangeRate in the repository.
        Parameters:
        source - The source currency the Exchange rates must have.
        target - The source currency the Exchange rates must have.
        Returns:
      • lookup

        public ExchangeRate lookup(Currency source,
                                   Currency target,
                                   Date date,
                                   ExchangeRate.Type type)
        Lookup the exchange rate between two currencies at a given date. If the given type is Direct, only direct exchange rates will be returned if available; if Derived, direct rates are still preferred but derived rates are allowed. Warning: if two or more exchange-rate chains are possible which allow to specify a requested rate, it is unspecified which one is returned.
        Parameters:
        source - The source currency of the exchange rate to be found. Currency
        target - The target currency of the exchange rate to be found. Currency
        date - The date when this exchange rate should be valid. Date
        type - The type of the exchange rate. ExchangeRate.Type
        Returns:
        The exchange rate fulfilling all these properties. ExchangeRate
      • clear

        public void clear()
        Removes all manually added exchange rates from this ExchangeRateManager.
      • hash

        public int hash(Currency c1,
                        Currency c2)
        Creates a hash for two currencies.
        Parameters:
        c1 - Currency one. Currency
        c2 - Currency two. Currency
        Returns:
        A hash of these to currencies. int
      • hashes

        public boolean hashes(int k,
                              Currency c)
        ???????????????????????????????????????????????
        Parameters:
        k -
        c -
        Returns:
      • fetch

        public ExchangeRate fetch(Currency source,
                                  Currency target,
                                  Date date)
        Fetches an ExchangeRate from the HashMap.
        Parameters:
        source - The source currency of the exchange rate.
        target - The target currency of the exchange rate.
        date - The date when the exchange rate should be valid.
        Returns:
        The found ExchangeRate.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.