## Class RateAccrualPeriod

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

public final class RateAccrualPeriod
extends java.lang.Object
implements ImmutableBean, java.io.Serializable
A period over which a fixed or floating rate is accrued.

A swap leg consists of one or more periods that are the basis of accrual. This class represents one such period.

This class specifies the data necessary to calculate the value of the period. The key property is the rateComputation which defines how the rate is observed.

Serialized Form
• ### Nested Class Summary

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

All Methods
Modifier and Type Method Description
static RateAccrualPeriod.Builder builder()
Returns a builder used to create an instance of the bean.
static RateAccrualPeriod.Builder builder​(SchedulePeriod period)
Returns a builder used to create an instance of the bean, based on a schedule period.
boolean equals​(java.lang.Object obj)
java.time.LocalDate getEndDate()
Gets the end date of the accrual period.
double getGearing()
Gets the gearing multiplier, defaulted to 1.
NegativeRateMethod getNegativeRateMethod()
Gets the negative rate method, defaulted to 'AllowNegative'.
RateComputation getRateComputation()
Gets the rate to be computed.
double getSpread()
Gets the spread rate, defaulted to 0.
java.time.LocalDate getStartDate()
Gets the start date of the accrual period.
java.time.LocalDate getUnadjustedEndDate()
java.time.LocalDate getUnadjustedStartDate()
double getYearFraction()
Gets the year fraction that the accrual period represents.
int hashCode()
static RateAccrualPeriod.Meta meta()
The meta-bean for RateAccrualPeriod.
RateAccrualPeriod.Meta metaBean()
RateAccrualPeriod.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

• #### builder

public static RateAccrualPeriod.Builder builder​(SchedulePeriod period)
Returns a builder used to create an instance of the bean, based on a schedule period.

The start date and end date (adjusted and unadjusted) will be set in the builder.

Parameters:
period - the schedule period
Returns:
the builder, not null
• #### meta

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

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

public RateAccrualPeriod.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### getStartDate

public java.time.LocalDate getStartDate()
Gets the start date of the accrual period.

This is the first accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.

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

public java.time.LocalDate getEndDate()
Gets the end date of the accrual period.

This is the last accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.

Returns:
the value of the property, not null

public java.time.LocalDate getUnadjustedStartDate()

When building, this will default to the start date if not specified.

Returns:
the value of the property, not null

public java.time.LocalDate getUnadjustedEndDate()

When building, this will default to the end date if not specified.

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

public double getYearFraction()
Gets the year fraction that the accrual period represents.

The value is usually calculated using a DayCount which may be different to that of the index. Typically the value will be close to 1 for one year and close to 0.5 for six months. The fraction may be greater than 1, but not less than 0.

Returns:
the value of the property
• #### getRateComputation

public RateComputation getRateComputation()
Gets the rate to be computed.

The value of the period is based on this rate. Different implementations of the RateComputation interface have different approaches to computing the rate, including averaging, overnight and interpolation. For example, it might be a well known market index such as 'GBP-LIBOR-3M'.

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

public double getGearing()
Gets the gearing multiplier, defaulted to 1.

This defines the gearing, which is used to multiply the observed rate.

When calculating the rate, the observed rate is multiplied by the gearing. If both gearing and spread exist, then the gearing is applied first. A gearing of 1 has no effect.

Gearing is also known as leverage.

Returns:
the value of the property

public double getSpread()
Gets the spread rate, defaulted to 0. A 5% rate will be expressed as 0.05.

This defines the spread, which is used to add an amount the observed rate.

When calculating the rate, the spread is added to the observed rate. If both gearing and spread exist, then the gearing is applied first. A spread of 0 has no effect.

Defined by the 2006 ISDA definitions article 6.2e.

Returns:
the value of the property
• #### getNegativeRateMethod

public NegativeRateMethod getNegativeRateMethod()
Gets the negative rate method, defaulted to 'AllowNegative'.

This is used when the interest rate, observed or calculated, goes negative.

When observing or calculating the rate, the value may go negative. If it does, then this method is used to validate whether the negative rate is allowed. It is applied after any applicable gearing or spread.

Defined by the 2006 ISDA definitions article 6.4.

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

public RateAccrualPeriod.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