## Interface RateCalculation

• All Known Implementing Classes:
FixedRateCalculation, IborRateCalculation, InflationRateCalculation, OvernightRateCalculation

public interface RateCalculation
The accrual calculation part of an interest rate swap leg.

An interest rate swap leg is defined by RateCalculationSwapLeg. The rate to be paid is defined by the implementations of this interface.

Implementations must be immutable and thread-safe beans.

• ### Method Summary

All Methods
Modifier and Type Method Description
void collectCurrencies​(com.google.common.collect.ImmutableSet.Builder<Currency> builder)
Collects all the currencies referred to by this calculation.
void collectIndices​(com.google.common.collect.ImmutableSet.Builder<Index> builder)
Collects all the indices referred to by this calculation.
com.google.common.collect.ImmutableList<RateAccrualPeriod> createAccrualPeriods​(Schedule accrualSchedule, Schedule paymentSchedule, ReferenceData refData)
Creates accrual periods based on the specified schedule.
DayCount getDayCount()
Gets the day count convention.
SwapLegType getType()
Gets the type of the leg, such as Fixed or Ibor.
• ### Method Detail

• #### getType

SwapLegType getType()
Gets the type of the leg, such as Fixed or Ibor.

This provides a high level categorization of the swap leg.

Returns:
the leg type
• #### getDayCount

DayCount getDayCount()
Gets the day count convention.

This is used to convert schedule period dates to a numerical value.

Returns:
the day count convention
• #### collectCurrencies

void collectCurrencies​(com.google.common.collect.ImmutableSet.Builder<Currency> builder)
Collects all the currencies referred to by this calculation.

This collects the complete set of currencies for the calculation, not just the payment currencies.

Parameters:
builder - the builder to populate
• #### collectIndices

void collectIndices​(com.google.common.collect.ImmutableSet.Builder<Index> builder)
Collects all the indices referred to by this calculation.

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

Parameters:
builder - the builder to use
• #### createAccrualPeriods

com.google.common.collect.ImmutableList<RateAccrualPeriod> createAccrualPeriods​(Schedule accrualSchedule,
Schedule paymentSchedule,
ReferenceData refData)
Creates accrual periods based on the specified schedule.

The specified accrual schedule defines the period dates to be created. One instance of RateAccrualPeriod must be created for each period in the schedule.

Parameters:
accrualSchedule - the accrual schedule
paymentSchedule - the payment schedule
refData - the reference data to use when resolving
Returns:
the accrual periods
Throws:
ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
java.lang.RuntimeException - if the calculation is invalid