Class FxIndexObservation

  • All Implemented Interfaces:
    IndexObservation, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class FxIndexObservation
    extends Object
    implements IndexObservation, org.joda.beans.ImmutableBean, Serializable
    Information about a single observation of an FX index.

    Observing an FX index requires knowledge of the index, fixing date and maturity date.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static FxIndexObservation of​(FxIndex index,
                                            LocalDate fixingDate,
                                            ReferenceData refData)
        Creates an instance from an index and fixing date.

        The reference data is used to find the maturity date from the fixing date.

        Parameters:
        index - the index
        fixingDate - the fixing date
        refData - the reference data to use when resolving holiday calendars
        Returns:
        the rate observation
      • getCurrencyPair

        public CurrencyPair getCurrencyPair()
        Gets the currency pair of the FX index.
        Returns:
        the currency pair of the index
      • equals

        public boolean equals​(Object obj)
        Compares this observation to another based on the index and fixing date.

        The maturity date is ignored.

        Overrides:
        equals in class Object
        Parameters:
        obj - the other observation
        Returns:
        true if equal
      • hashCode

        public int hashCode()
        Returns a hash code based on the index and fixing date.

        The maturity date is ignored.

        Overrides:
        hashCode in class Object
        Returns:
        the hash code
      • meta

        public static FxIndexObservation.Meta meta()
        The meta-bean for FxIndexObservation.
        Returns:
        the meta-bean, not null
      • getIndex

        public FxIndex getIndex()
        Gets the FX index.

        The rate will be queried from this index.

        Specified by:
        getIndex in interface IndexObservation
        Returns:
        the value of the property, not null
      • getFixingDate

        public LocalDate getFixingDate()
        Gets the date of the index fixing.

        This is an adjusted date with any business day rule applied. Valid business days are defined by FxIndex.getFixingCalendar().

        Returns:
        the value of the property, not null