Class OvernightIndexObservation

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

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

    Observing an Overnight index requires knowledge of the index, fixing date, publication date, effective date and maturity date.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static OvernightIndexObservation of​(OvernightIndex index,
                                                   LocalDate fixingDate,
                                                   ReferenceData refData)
        Creates an IborRateObservation from an index and fixing date.

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

        index - the index
        fixingDate - the fixing date
        refData - the reference data to use when resolving holiday calendars
        the rate observation
      • getCurrency

        public Currency getCurrency()
        Gets the currency of the Overnight index.
        the currency of the index
      • equals

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

        The publication, effective and maturity dates are ignored.

        equals in class Object
        obj - the other observation
        true if equal
      • hashCode

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

        The maturity date is ignored.

        hashCode in class Object
        the hash code
      • getIndex

        public OvernightIndex getIndex()
        Gets the Overnight index.

        The rate will be queried from this index.

        Specified by:
        getIndex in interface IndexObservation
        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 RateIndex.getFixingCalendar().

        the value of the property, not null
      • getYearFraction

        public double getYearFraction()
        Gets the year fraction of the investment implied by the fixing date.

        This is calculated using the day count of the index. It represents the fraction of the year between the effective date and the maturity date. Typically the value will be close to 1 for one year and close to 0.5 for six months.

        the value of the property, not null