public final class RateAccrualPeriod extends Object implements org.joda.beans.ImmutableBean, Serializable
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
RateAccrualPeriod.Builder
The bean-builder for
RateAccrualPeriod. |
static class |
RateAccrualPeriod.Meta
The meta-bean for
RateAccrualPeriod. |
| Modifier and Type | Method and 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(Object obj) |
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.
|
LocalDate |
getStartDate()
Gets the start date of the accrual period.
|
LocalDate |
getUnadjustedEndDate()
Gets the unadjusted end date.
|
LocalDate |
getUnadjustedStartDate()
Gets the unadjusted start date.
|
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.
|
String |
toString() |
public static RateAccrualPeriod.Builder builder(SchedulePeriod period)
The start date and end date (adjusted and unadjusted) will be set in the builder.
period - the schedule periodpublic static RateAccrualPeriod.Meta meta()
RateAccrualPeriod.public static RateAccrualPeriod.Builder builder()
public RateAccrualPeriod.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic LocalDate getStartDate()
This is the first accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.
public LocalDate getEndDate()
This is the last accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.
public LocalDate getUnadjustedStartDate()
The start date before any business day adjustment is applied.
When building, this will default to the start date if not specified.
public LocalDate getUnadjustedEndDate()
The end date before any business day adjustment is applied.
When building, this will default to the end date if not specified.
public double getYearFraction()
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.
public RateComputation getRateComputation()
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'.
public double getGearing()
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.
public double getSpread()
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.
public NegativeRateMethod getNegativeRateMethod()
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.
public RateAccrualPeriod.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.