Class FixedRateCalculation
- java.lang.Object
-
- com.opengamma.strata.product.swap.FixedRateCalculation
-
- All Implemented Interfaces:
RateCalculation,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class FixedRateCalculation extends Object implements RateCalculation, org.joda.beans.ImmutableBean, 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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFixedRateCalculation.BuilderThe bean-builder forFixedRateCalculation.static classFixedRateCalculation.MetaThe meta-bean forFixedRateCalculation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FixedRateCalculation.Builderbuilder()Returns a builder used to create an instance of the bean.voidcollectCurrencies(ImmutableSet.Builder<Currency> builder)Collects all the currencies referred to by this calculation.voidcollectIndices(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.booleanequals(Object obj)DayCountgetDayCount()Gets the day count convention.Optional<FixedRateStubCalculation>getFinalStub()Gets the final stub, optional.Optional<FutureValueNotional>getFutureValueNotional()Gets the future value notional.Optional<FixedRateStubCalculation>getInitialStub()Gets the initial stub, optional.ValueSchedulegetRate()Gets the interest rate to be paid.SwapLegTypegetType()Gets the type of the leg, such as Fixed or Ibor.inthashCode()static FixedRateCalculation.Metameta()The meta-bean forFixedRateCalculation.FixedRateCalculation.MetametaBean()static FixedRateCalculationof(double rate, DayCount dayCount)Obtains a rate calculation for the specified day count and rate.FixedRateCalculation.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()
-
-
-
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 ratedayCount- the day count- Returns:
- the calculation
-
getType
public SwapLegType getType()
Description copied from interface:RateCalculationGets the type of the leg, such as Fixed or Ibor.This provides a high level categorization of the swap leg.
- Specified by:
getTypein interfaceRateCalculation- Returns:
- the leg type
-
collectCurrencies
public void collectCurrencies(ImmutableSet.Builder<Currency> builder)
Description copied from interface:RateCalculationCollects 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:
collectCurrenciesin interfaceRateCalculation- Parameters:
builder- the builder to populate
-
collectIndices
public void collectIndices(ImmutableSet.Builder<Index> builder)
Description copied from interface:RateCalculationCollects 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:
collectIndicesin interfaceRateCalculation- Parameters:
builder- the builder to use
-
createAccrualPeriods
public ImmutableList<RateAccrualPeriod> createAccrualPeriods(Schedule accrualSchedule, Schedule paymentSchedule, ReferenceData refData)
Description copied from interface:RateCalculationCreates accrual periods based on the specified schedule.The specified accrual schedule defines the period dates to be created. One instance of
RateAccrualPeriodmust be created for each period in the schedule.- Specified by:
createAccrualPeriodsin interfaceRateCalculation- Parameters:
accrualSchedule- the accrual schedulepaymentSchedule- the payment schedulerefData- the reference data to use when resolving- Returns:
- the accrual periods
-
meta
public static FixedRateCalculation.Meta meta()
The meta-bean forFixedRateCalculation.- 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:
metaBeanin interfaceorg.joda.beans.Bean
-
getDayCount
public DayCount getDayCount()
Gets the day count convention.This is used to convert schedule period dates to a numerical value.
- Specified by:
getDayCountin interfaceRateCalculation- 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 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
rateproperty 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 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
rateproperty 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 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
-
-