Class ImmutableOvernightIndex
- java.lang.Object
-
- com.opengamma.strata.basics.index.ImmutableOvernightIndex
-
- All Implemented Interfaces:
FloatingRate,FloatingRateIndex,Index,OvernightIndex,RateIndex,Named,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ImmutableOvernightIndex extends Object implements OvernightIndex, org.joda.beans.ImmutableBean, Serializable
An overnight index, such as Sonia or Eonia.An index represented by this class relates to lending over one night. The rate typically refers to "Today/Tomorrow" but might refer to "Tomorrow/Next".
The index is defined by four dates. The fixing date is the date on which the index is to be observed. The publication date is the date on which the fixed rate is actually published. The effective date is the date on which the implied deposit starts. The maturity date is the date on which the implied deposit ends.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableOvernightIndex.BuilderThe bean-builder forImmutableOvernightIndex.static classImmutableOvernightIndex.MetaThe meta-bean forImmutableOvernightIndex.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableOvernightIndex.Builderbuilder()Returns a builder used to create an instance of the bean.LocalDatecalculateEffectiveFromFixing(LocalDate fixingDate, ReferenceData refData)Calculates the effective date from the fixing date.LocalDatecalculateFixingFromEffective(LocalDate effectiveDate, ReferenceData refData)Calculates the fixing date from the effective date.LocalDatecalculateMaturityFromEffective(LocalDate effectiveDate, ReferenceData refData)Calculates the maturity date from the effective date.LocalDatecalculateMaturityFromFixing(LocalDate fixingDate, ReferenceData refData)Calculates the maturity date from the fixing date.LocalDatecalculatePublicationFromFixing(LocalDate fixingDate, ReferenceData refData)Calculates the publication date from the fixing date.booleanequals(Object obj)CurrencygetCurrency()Gets the currency of the index.DayCountgetDayCount()Gets the day count convention.DayCountgetDefaultFixedLegDayCount()Gets the default day count convention for the associated fixed leg.intgetEffectiveDateOffset()Gets the number of days to add to the fixing date to obtain the effective date.HolidayCalendarIdgetFixingCalendar()Gets the calendar that the index uses.FloatingRateNamegetFloatingRateName()Gets the floating rate name for this index.StringgetName()Gets the index name, such as 'GBP-SONIA'.intgetPublicationDateOffset()Gets the number of days to add to the fixing date to obtain the publication date.TenorgetTenor()Gets the tenor of the index.inthashCode()booleanisActive()Gets whether the index is active, defaulted to true.static ImmutableOvernightIndex.Metameta()The meta-bean forImmutableOvernightIndex.ImmutableOvernightIndex.MetametaBean()ImmutableOvernightIndex.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()Returns the name of the index.
-
-
-
Method Detail
-
getTenor
public Tenor getTenor()
Description copied from interface:RateIndexGets the tenor of the index.
-
getFloatingRateName
public FloatingRateName getFloatingRateName()
Description copied from interface:FloatingRateIndexGets the floating rate name for this index.For an Ibor index, the
FloatingRateNamedoes not include the tenor. It can be used to find the other tenors available for this index.- Specified by:
getFloatingRateNamein interfaceFloatingRate- Specified by:
getFloatingRateNamein interfaceFloatingRateIndex- Returns:
- the floating rate name
-
calculatePublicationFromFixing
public LocalDate calculatePublicationFromFixing(LocalDate fixingDate, ReferenceData refData)
Description copied from interface:OvernightIndexCalculates the publication date from the fixing date.The fixing date is the date on which the index is to be observed. The publication date is the date on which the fixed rate is actually published.
No error is thrown if the input date is not a valid fixing date. Instead, the fixing date is moved to the next valid fixing date and then processed.
- Specified by:
calculatePublicationFromFixingin interfaceOvernightIndex- Parameters:
fixingDate- the fixing daterefData- the reference data, used to resolve the holiday calendar- Returns:
- the publication date
-
calculateEffectiveFromFixing
public LocalDate calculateEffectiveFromFixing(LocalDate fixingDate, ReferenceData refData)
Description copied from interface:OvernightIndexCalculates the effective date from the fixing date.The fixing date is the date on which the index is to be observed. The effective date is the date on which the implied deposit starts.
No error is thrown if the input date is not a valid fixing date. Instead, the fixing date is moved to the next valid fixing date and then processed.
- Specified by:
calculateEffectiveFromFixingin interfaceOvernightIndex- Parameters:
fixingDate- the fixing daterefData- the reference data, used to resolve the holiday calendar- Returns:
- the effective date
-
calculateMaturityFromFixing
public LocalDate calculateMaturityFromFixing(LocalDate fixingDate, ReferenceData refData)
Description copied from interface:OvernightIndexCalculates the maturity date from the fixing date.The fixing date is the date on which the index is to be observed. The maturity date is the date on which the implied deposit ends.
No error is thrown if the input date is not a valid fixing date. Instead, the fixing date is moved to the next valid fixing date and then processed.
- Specified by:
calculateMaturityFromFixingin interfaceOvernightIndex- Parameters:
fixingDate- the fixing daterefData- the reference data, used to resolve the holiday calendar- Returns:
- the maturity date
-
calculateFixingFromEffective
public LocalDate calculateFixingFromEffective(LocalDate effectiveDate, ReferenceData refData)
Description copied from interface:OvernightIndexCalculates the fixing date from the effective date.The fixing date is the date on which the index is to be observed. The effective date is the date on which the implied deposit starts.
No error is thrown if the input date is not a valid effective date. Instead, the effective date is moved to the next valid effective date and then processed.
- Specified by:
calculateFixingFromEffectivein interfaceOvernightIndex- Parameters:
effectiveDate- the effective daterefData- the reference data, used to resolve the holiday calendar- Returns:
- the fixing date
-
calculateMaturityFromEffective
public LocalDate calculateMaturityFromEffective(LocalDate effectiveDate, ReferenceData refData)
Description copied from interface:OvernightIndexCalculates the maturity date from the effective date.The effective date is the date on which the implied deposit starts. The maturity date is the date on which the implied deposit ends.
No error is thrown if the input date is not a valid effective date. Instead, the effective date is moved to the next valid effective date and then processed.
- Specified by:
calculateMaturityFromEffectivein interfaceOvernightIndex- Parameters:
effectiveDate- the effective daterefData- the reference data, used to resolve the holiday calendar- Returns:
- the maturity date
-
toString
public String toString()
Returns the name of the index.
-
meta
public static ImmutableOvernightIndex.Meta meta()
The meta-bean forImmutableOvernightIndex.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableOvernightIndex.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableOvernightIndex.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getName
public String getName()
Gets the index name, such as 'GBP-SONIA'.- Specified by:
getNamein interfaceFloatingRateIndex- Specified by:
getNamein interfaceIndex- Specified by:
getNamein interfaceNamed- Specified by:
getNamein interfaceOvernightIndex- Specified by:
getNamein interfaceRateIndex- Returns:
- the value of the property, not null
-
getCurrency
public Currency getCurrency()
Gets the currency of the index.- Specified by:
getCurrencyin interfaceFloatingRate- Specified by:
getCurrencyin interfaceFloatingRateIndex- Returns:
- the value of the property, not null
-
isActive
public boolean isActive()
Gets whether the index is active, defaulted to true.Over time some indices become inactive and are no longer produced. If this occurs, this flag will be set to false.
- Specified by:
isActivein interfaceFloatingRateIndex- Returns:
- the value of the property
-
getFixingCalendar
public HolidayCalendarId getFixingCalendar()
Gets the calendar that the index uses.All dates are calculated with reference to the same calendar.
- Specified by:
getFixingCalendarin interfaceRateIndex- Returns:
- the value of the property, not null
-
getPublicationDateOffset
public int getPublicationDateOffset()
Gets the number of days to add to the fixing date to obtain the publication date.In most cases, the fixing rate is available on the fixing date. In a few cases, publication of the fixing rate is delayed until the following business day. This property is zero if publication is on the fixing date, or one if it is the next day.
- Specified by:
getPublicationDateOffsetin interfaceOvernightIndex- Returns:
- the value of the property, not null
-
getEffectiveDateOffset
public int getEffectiveDateOffset()
Gets the number of days to add to the fixing date to obtain the effective date.In most cases, the settlement date and start of the implied deposit is on the fixing date. In a few cases, the settlement date is the following business day. This property is zero if settlement is on the fixing date, or one if it is the next day. Maturity is always one business day after the settlement date.
- Specified by:
getEffectiveDateOffsetin interfaceOvernightIndex- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention.- Specified by:
getDayCountin interfaceFloatingRateIndex- Returns:
- the value of the property, not null
-
getDefaultFixedLegDayCount
public DayCount getDefaultFixedLegDayCount()
Gets the default day count convention for the associated fixed leg.A rate index is often paid against a fixed leg, such as in a vanilla Swap. The day count convention of the fixed leg often differs from that of the index, and the default is value is available here.
- Specified by:
getDefaultFixedLegDayCountin interfaceFloatingRateIndex- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableOvernightIndex.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-