Class ImmutableOvernightIndex

  • All Implemented Interfaces:
    FloatingRateIndex, Index, OvernightIndex, RateIndex, Named, java.io.Serializable, Bean, ImmutableBean

    public final class ImmutableOvernightIndex
    extends java.lang.Object
    implements OvernightIndex, ImmutableBean, java.io.Serializable
    An overnight index, such as Sonia or Eonia.

    An index represented by this class relates to lending over one night. The rate typically refers to "Today/Tomorrow" but might refer to "Tomorrow/Next".

    The index is defined by four dates. The fixing date is the date on which the index is to be observed. The publication date is the date on which the fixed rate is actually published. The effective date is the date on which the implied deposit starts. The maturity date is the date on which the implied deposit ends.

    See Also:
    Serialized Form
    • Method Detail

      • getTenor

        public Tenor getTenor()
        Description copied from interface: RateIndex
        Gets the tenor of the index.
        Specified by:
        getTenor in interface RateIndex
        Returns:
        the tenor
      • calculatePublicationFromFixing

        public java.time.LocalDate calculatePublicationFromFixing​(java.time.LocalDate fixingDate,
                                                                  ReferenceData refData)
        Description copied from interface: OvernightIndex
        Calculates the publication date from the fixing date.

        The fixing date is the date on which the index is to be observed. The publication date is the date on which the fixed rate is actually published.

        No error is thrown if the input date is not a valid fixing date. Instead, the fixing date is moved to the next valid fixing date and then processed.

        Specified by:
        calculatePublicationFromFixing in interface OvernightIndex
        Parameters:
        fixingDate - the fixing date
        refData - the reference data, used to resolve the holiday calendar
        Returns:
        the publication date
      • calculateEffectiveFromFixing

        public java.time.LocalDate calculateEffectiveFromFixing​(java.time.LocalDate fixingDate,
                                                                ReferenceData refData)
        Description copied from interface: OvernightIndex
        Calculates the effective date from the fixing date.

        The fixing date is the date on which the index is to be observed. The effective date is the date on which the implied deposit starts.

        No error is thrown if the input date is not a valid fixing date. Instead, the fixing date is moved to the next valid fixing date and then processed.

        Specified by:
        calculateEffectiveFromFixing in interface OvernightIndex
        Parameters:
        fixingDate - the fixing date
        refData - the reference data, used to resolve the holiday calendar
        Returns:
        the effective date
      • calculateMaturityFromFixing

        public java.time.LocalDate calculateMaturityFromFixing​(java.time.LocalDate fixingDate,
                                                               ReferenceData refData)
        Description copied from interface: OvernightIndex
        Calculates the maturity date from the fixing date.

        The fixing date is the date on which the index is to be observed. The maturity date is the date on which the implied deposit ends.

        No error is thrown if the input date is not a valid fixing date. Instead, the fixing date is moved to the next valid fixing date and then processed.

        Specified by:
        calculateMaturityFromFixing in interface OvernightIndex
        Parameters:
        fixingDate - the fixing date
        refData - the reference data, used to resolve the holiday calendar
        Returns:
        the maturity date
      • calculateFixingFromEffective

        public java.time.LocalDate calculateFixingFromEffective​(java.time.LocalDate effectiveDate,
                                                                ReferenceData refData)
        Description copied from interface: OvernightIndex
        Calculates the fixing date from the effective date.

        The fixing date is the date on which the index is to be observed. The effective date is the date on which the implied deposit starts.

        No error is thrown if the input date is not a valid effective date. Instead, the effective date is moved to the next valid effective date and then processed.

        Specified by:
        calculateFixingFromEffective in interface OvernightIndex
        Parameters:
        effectiveDate - the effective date
        refData - the reference data, used to resolve the holiday calendar
        Returns:
        the fixing date
      • calculateMaturityFromEffective

        public java.time.LocalDate calculateMaturityFromEffective​(java.time.LocalDate effectiveDate,
                                                                  ReferenceData refData)
        Description copied from interface: OvernightIndex
        Calculates the maturity date from the effective date.

        The effective date is the date on which the implied deposit starts. The maturity date is the date on which the implied deposit ends.

        No error is thrown if the input date is not a valid effective date. Instead, the effective date is moved to the next valid effective date and then processed.

        Specified by:
        calculateMaturityFromEffective in interface OvernightIndex
        Parameters:
        effectiveDate - the effective date
        refData - the reference data, used to resolve the holiday calendar
        Returns:
        the maturity date
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns the name of the index.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the name of the index
      • builder

        public static ImmutableOvernightIndex.Builder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • getName

        public java.lang.String getName()
        Gets the index name, such as 'GBP-SONIA'.
        Specified by:
        getName in interface Index
        Specified by:
        getName in interface Named
        Specified by:
        getName in interface OvernightIndex
        Returns:
        the value of the property, not null
      • getCurrency

        public Currency getCurrency()
        Gets the currency of the index.
        Specified by:
        getCurrency in interface FloatingRateIndex
        Returns:
        the value of the property, not null
      • isActive

        public boolean isActive()
        Gets whether the index is active, defaulted to true.

        Over time some indices become inactive and are no longer produced. If this occurs, this flag will be set to false.

        Specified by:
        isActive in interface FloatingRateIndex
        Returns:
        the value of the property
      • getFixingCalendar

        public HolidayCalendarId getFixingCalendar()
        Gets the calendar that the index uses.

        All dates are calculated with reference to the same calendar.

        Specified by:
        getFixingCalendar in interface RateIndex
        Returns:
        the value of the property, not null
      • getPublicationDateOffset

        public int getPublicationDateOffset()
        Gets the number of days to add to the fixing date to obtain the publication date.

        In most cases, the fixing rate is available on the fixing date. In a few cases, publication of the fixing rate is delayed until the following business day. This property is zero if publication is on the fixing date, or one if it is the next day.

        Specified by:
        getPublicationDateOffset in interface OvernightIndex
        Returns:
        the value of the property, not null
      • getEffectiveDateOffset

        public int getEffectiveDateOffset()
        Gets the number of days to add to the fixing date to obtain the effective date.

        In most cases, the settlement date and start of the implied deposit is on the fixing date. In a few cases, the settlement date is the following business day. This property is zero if settlement is on the fixing date, or one if it is the next day. Maturity is always one business day after the settlement date.

        Specified by:
        getEffectiveDateOffset in interface OvernightIndex
        Returns:
        the value of the property, not null
      • getDayCount

        public DayCount getDayCount()
        Gets the day count convention.
        Specified by:
        getDayCount in interface FloatingRateIndex
        Returns:
        the value of the property, not null
      • getDefaultFixedLegDayCount

        public DayCount getDefaultFixedLegDayCount()
        Gets the default day count convention for the associated fixed leg.

        A rate index is often paid against a fixed leg, such as in a vanilla Swap. The day count convention of the fixed leg often differs from that of the index, and the default is value is available here.

        Specified by:
        getDefaultFixedLegDayCount in interface FloatingRateIndex
        Returns:
        the value of the property, not null
      • toBuilder

        public ImmutableOvernightIndex.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null