## Class FixedRateCalculation

• java.lang.Object
• com.opengamma.strata.product.swap.FixedRateCalculation
• All Implemented Interfaces:
RateCalculation, java.io.Serializable, Bean, ImmutableBean

public final class FixedRateCalculation
extends java.lang.Object
implements RateCalculation, ImmutableBean, java.io.Serializable
Defines the calculation of a fixed rate swap leg.

This defines the data necessary to calculate the amount payable on the leg. The amount is based on a fixed rate, which can vary over the lifetime of the leg.

Serialized Form
• ### Nested Class Summary

Nested Classes
Modifier and Type Class Description
static class  FixedRateCalculation.Builder
The bean-builder for FixedRateCalculation.
static class  FixedRateCalculation.Meta
The meta-bean for FixedRateCalculation.
• ### Method Summary

All Methods
Modifier and Type Method Description
static FixedRateCalculation.Builder builder()
Returns a builder used to create an instance of the bean.
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.
boolean equals​(java.lang.Object obj)
DayCount getDayCount()
Gets the day count convention.
java.util.Optional<FixedRateStubCalculation> getFinalStub()
Gets the final stub, optional.
java.util.Optional<FutureValueNotional> getFutureValueNotional()
Gets the future value notional.
java.util.Optional<FixedRateStubCalculation> getInitialStub()
Gets the initial stub, optional.
ValueSchedule getRate()
Gets the interest rate to be paid.
SwapLegType getType()
Gets the type of the leg, such as Fixed or Ibor.
int hashCode()
static FixedRateCalculation.Meta meta()
The meta-bean for FixedRateCalculation.
FixedRateCalculation.Meta metaBean()
static FixedRateCalculation of​(double rate, DayCount dayCount)
Obtains a rate calculation for the specified day count and rate.
FixedRateCalculation.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
java.lang.String toString()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• ### Method Detail

• #### of

public static FixedRateCalculation of​(double rate,
DayCount dayCount)
Obtains a rate calculation for the specified day count and rate.

The rate specified here does not vary during the life of the swap. If this method provides insufficient control, use the builder.

Parameters:
rate - the rate
dayCount - the day count
Returns:
the calculation
• #### getType

public SwapLegType getType()
Description copied from interface: RateCalculation
Gets the type of the leg, such as Fixed or Ibor.

This provides a high level categorization of the swap leg.

Specified by:
getType in interface RateCalculation
Returns:
the leg type
• #### collectCurrencies

public void collectCurrencies​(com.google.common.collect.ImmutableSet.Builder<Currency> builder)
Description copied from interface: RateCalculation
Collects all the currencies referred to by this calculation.

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

Specified by:
collectCurrencies in interface RateCalculation
Parameters:
builder - the builder to populate
• #### collectIndices

public void collectIndices​(com.google.common.collect.ImmutableSet.Builder<Index> builder)
Description copied from interface: RateCalculation
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.

Specified by:
collectIndices in interface RateCalculation
Parameters:
builder - the builder to use
• #### createAccrualPeriods

public com.google.common.collect.ImmutableList<RateAccrualPeriod> createAccrualPeriods​(Schedule accrualSchedule,
Schedule paymentSchedule,
ReferenceData refData)
Description copied from interface: RateCalculation
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.

Specified by:
createAccrualPeriods in interface RateCalculation
Parameters:
accrualSchedule - the accrual schedule
paymentSchedule - the payment schedule
refData - the reference data to use when resolving
Returns:
the accrual periods
• #### meta

public static FixedRateCalculation.Meta meta()
The meta-bean for FixedRateCalculation.
Returns:
the meta-bean, not null
• #### builder

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

public FixedRateCalculation.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### getDayCount

public DayCount getDayCount()
Gets the day count convention.

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

Specified by:
getDayCount in interface RateCalculation
Returns:
the value of the property, not null
• #### getRate

public ValueSchedule getRate()
Gets the interest rate to be paid. A 5% rate will be expressed as 0.05.

This defines the rate as an initial amount and a list of adjustments. The rate is only permitted to change at accrual period boundaries.

Returns:
the value of the property, not null
• #### getInitialStub

public java.util.Optional<FixedRateStubCalculation> getInitialStub()
Gets the initial stub, optional.

The initial stub of a swap may have a different rate from the regular accrual periods. This property allows the stub rate to be specified, either as a known amount or a rate. If this property is not present, then the rate derived from the rate property applies during the stub. If this property is present and there is no initial stub, it is ignored.

Returns:
the optional value of the property, not null
• #### getFinalStub

public java.util.Optional<FixedRateStubCalculation> getFinalStub()
Gets the final stub, optional.

The final stub of a swap may have a different rate from the regular accrual periods. This property allows the stub rate to be specified, either as a known amount or a rate. If this property is not present, then the rate derived from the rate property applies during the stub. If this property is present and there is no initial stub, it is ignored.

Returns:
the optional value of the property, not null
• #### getFutureValueNotional

public java.util.Optional<FutureValueNotional> getFutureValueNotional()
Gets the future value notional.

This property is used when the fixed leg of a swap has a future value notional. This is typically used for Brazilian swaps.

Returns:
the optional value of the property, not null
• #### toBuilder

public FixedRateCalculation.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
Returns:
the mutable builder, not null
• #### 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()
Overrides:
toString in class java.lang.Object