Class IborInterpolatedRateComputation

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

    public final class IborInterpolatedRateComputation
    extends Object
    implements RateComputation, org.joda.beans.ImmutableBean, Serializable
    Defines the computation of a rate of interest interpolated from two Ibor indices.

    An interest rate determined from two Ibor indices by linear interpolation. Both indices are observed on the same fixing date and they must have the same currency. For example, linear interpolation between 'GBP-LIBOR-1M' and 'GBP-LIBOR-3M'.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static IborInterpolatedRateComputation of​(IborIndex index1,
                                                         IborIndex index2,
                                                         LocalDate fixingDate,
                                                         ReferenceData refData)
        Creates an instance from two indices and fixing date.

        The indices may be passed in any order.

        Parameters:
        index1 - the first index
        index2 - the second index
        fixingDate - the fixing date
        refData - the reference data to use when resolving holiday calendars
        Returns:
        the interpolated rate computation
      • of

        public static IborInterpolatedRateComputation of​(IborIndexObservation shortObservation,
                                                         IborIndexObservation longObservation)
        Creates an instance from the two underlying index observations.

        The two observations must be for two different indexes in the same currency on the same fixing date. The index with the shorter tenor must be passed as the first argument.

        Parameters:
        shortObservation - the short underlying index observation
        longObservation - the long underlying index observation
        Returns:
        the rate computation
        Throws:
        IllegalArgumentException - if the indices are not short, then long
      • getFixingDate

        public LocalDate getFixingDate()
        Gets the fixing date.
        Returns:
        the fixing date
      • collectIndices

        public void collectIndices​(ImmutableSet.Builder<Index> builder)
        Description copied from interface: RateComputation
        Collects all the indices referred to by this computation.

        A computation will typically refer to one index, such as 'GBP-LIBOR-3M'. Each index that is referred to must be added to the specified builder.

        Specified by:
        collectIndices in interface RateComputation
        Parameters:
        builder - the builder to use
      • getShortObservation

        public IborIndexObservation getShortObservation()
        Gets the shorter Ibor index observation.

        The rate to be paid is based on this index It will be a well known market index such as 'GBP-LIBOR-1M'.

        Returns:
        the value of the property, not null
      • getLongObservation

        public IborIndexObservation getLongObservation()
        Gets the longer Ibor index observation.

        The rate to be paid is based on this index It will be a well known market index such as 'GBP-LIBOR-3M'.

        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object