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 Instance Methods Abstract Methods Modifier and Type Method Description void
collectCurrencies(ImmutableSet.Builder<Currency> builder)
Collects all the currencies referred to by this calculation.void
collectIndices(ImmutableSet.Builder<Index> builder)
Collects all the indices referred to by this calculation.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(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(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
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 schedulepaymentSchedule
- the payment schedulerefData
- the reference data to use when resolving- Returns:
- the accrual periods
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference dataRuntimeException
- if the calculation is invalid
-
-