Class OvernightCompoundedRateComputation
- java.lang.Object
-
- com.opengamma.strata.product.rate.OvernightCompoundedRateComputation
-
- All Implemented Interfaces:
OvernightRateComputation
,RateComputation
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class OvernightCompoundedRateComputation extends Object implements OvernightRateComputation, org.joda.beans.ImmutableBean, Serializable
Defines the computation of a rate from a single Overnight index that is compounded daily.An interest rate determined directly from an Overnight index with daily compounding. For example, a rate determined by compounding values from 'GBP-SONIA'.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OvernightCompoundedRateComputation.Builder
The bean-builder forOvernightCompoundedRateComputation
.static class
OvernightCompoundedRateComputation.Meta
The meta-bean forOvernightCompoundedRateComputation
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OvernightCompoundedRateComputation.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
LocalDate
getEndDate()
Gets the fixing date associated with the end date of the accrual period.HolidayCalendar
getFixingCalendar()
Gets the resolved calendar that the index uses.OvernightIndex
getIndex()
Gets the Overnight index.int
getRateCutOffDays()
Gets the number of business days before the end of the period that the rate is cut off.LocalDate
getStartDate()
Gets the fixing date associated with the start date of the accrual period.int
hashCode()
static OvernightCompoundedRateComputation.Meta
meta()
The meta-bean forOvernightCompoundedRateComputation
.OvernightCompoundedRateComputation.Meta
metaBean()
static OvernightCompoundedRateComputation
of(OvernightIndex index, LocalDate startDate, LocalDate endDate, int rateCutOffDays, ReferenceData refData)
Creates an instance from an index, period dates and rate cut-off.static OvernightCompoundedRateComputation
of(OvernightIndex index, LocalDate startDate, LocalDate endDate, ReferenceData refData)
Creates an instance from an index and period datesOvernightCompoundedRateComputation.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.rate.OvernightRateComputation
calculateEffectiveFromFixing, calculateFixingFromEffective, calculateMaturityFromEffective, calculateMaturityFromFixing, calculatePublicationFromFixing, collectIndices, observeOn
-
-
-
-
Method Detail
-
of
public static OvernightCompoundedRateComputation of(OvernightIndex index, LocalDate startDate, LocalDate endDate, ReferenceData refData)
Creates an instance from an index and period datesNo rate cut-off applies.
- Parameters:
index
- the indexstartDate
- the first date of the accrual periodendDate
- the last date of the accrual periodrefData
- the reference data to use when resolving holiday calendars- Returns:
- the rate computation
-
of
public static OvernightCompoundedRateComputation of(OvernightIndex index, LocalDate startDate, LocalDate endDate, int rateCutOffDays, ReferenceData refData)
Creates an instance from an index, period dates and rate cut-off.Rate cut-off applies if the cut-off is 2 or greater. A value of 0 or 1 should be used if no cut-off applies.
- Parameters:
index
- the indexstartDate
- the first date of the accrual periodendDate
- the last date of the accrual periodrateCutOffDays
- the rate cut-off days offset, not negativerefData
- the reference data to use when resolving holiday calendars- Returns:
- the rate computation
-
meta
public static OvernightCompoundedRateComputation.Meta meta()
The meta-bean forOvernightCompoundedRateComputation
.- Returns:
- the meta-bean, not null
-
builder
public static OvernightCompoundedRateComputation.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public OvernightCompoundedRateComputation.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getIndex
public OvernightIndex getIndex()
Gets the Overnight index.The rate to be paid is based on this index. It will be a well known market index such as 'GBP-SONIA'.
- Specified by:
getIndex
in interfaceOvernightRateComputation
- Returns:
- the value of the property, not null
-
getFixingCalendar
public HolidayCalendar getFixingCalendar()
Gets the resolved calendar that the index uses.- Specified by:
getFixingCalendar
in interfaceOvernightRateComputation
- Returns:
- the value of the property, not null
-
getStartDate
public LocalDate getStartDate()
Gets the fixing date associated with the start date of the accrual period.This is also the first fixing date. The overnight rate is observed from this date onwards.
In general, the fixing dates and accrual dates are the same for an overnight index. However, in the case of a Tomorrow/Next index, the fixing period is one business day before the accrual period.
- Specified by:
getStartDate
in interfaceOvernightRateComputation
- Returns:
- the value of the property, not null
-
getEndDate
public LocalDate getEndDate()
Gets the fixing date associated with the end date of the accrual period.The overnight rate is observed until this date.
In general, the fixing dates and accrual dates are the same for an overnight index. However, in the case of a Tomorrow/Next index, the fixing period is one business day before the accrual period.
- Specified by:
getEndDate
in interfaceOvernightRateComputation
- Returns:
- the value of the property, not null
-
getRateCutOffDays
public int getRateCutOffDays()
Gets the number of business days before the end of the period that the rate is cut off.When a rate cut-off applies, the final daily rate is determined this number of days before the end of the period, with any subsequent days having the same rate.
The amount must be zero or positive. A value of zero or one will have no effect on the standard calculation. The fixing holiday calendar of the index is used to determine business days.
For example, a value of
3
means that the rate observed on(periodEndDate - 3 business days)
is also to be used on(periodEndDate - 2 business days)
and(periodEndDate - 1 business day)
.If there are multiple accrual periods in the payment period, then this should typically only be non-zero in the last accrual period.
- Returns:
- the value of the property
-
toBuilder
public OvernightCompoundedRateComputation.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-