public final class IborRateStubCalculation extends Object implements org.joda.beans.ImmutableBean, Serializable
A standard swap leg consists of a regular periodic schedule and one or two stub periods at each end. This class defines what floating rate to use during a stub.
The rate may be specified in three ways.
| Modifier and Type | Class and Description |
|---|---|
static class |
IborRateStubCalculation.Builder
The bean-builder for
IborRateStubCalculation. |
static class |
IborRateStubCalculation.Meta
The meta-bean for
IborRateStubCalculation. |
| Modifier and Type | Field and Description |
|---|---|
static IborRateStubCalculation |
NONE
An instance that has no special rate handling.
|
| Modifier and Type | Method and Description |
|---|---|
static IborRateStubCalculation.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
OptionalDouble |
getFixedRate()
Gets the fixed rate to use in the stub.
|
Optional<IborIndex> |
getIndex()
Gets the Ibor index to be used for the stub.
|
Optional<IborIndex> |
getIndexInterpolated()
Gets the second Ibor index to be used for the stub, linearly interpolated.
|
Optional<CurrencyAmount> |
getKnownAmount()
Gets the known amount to pay/receive for the stub.
|
int |
hashCode() |
boolean |
isFixedRate()
Checks if the stub has a fixed rate.
|
boolean |
isFloatingRate()
Checks if the stub has a floating rate.
|
boolean |
isInterpolated()
Checks if the stub has an interpolated rate.
|
boolean |
isKnownAmount()
Checks if the stub has a known amount.
|
static IborRateStubCalculation.Meta |
meta()
The meta-bean for
IborRateStubCalculation. |
IborRateStubCalculation.Meta |
metaBean() |
static IborRateStubCalculation |
ofFixedRate(double fixedRate)
Obtains an instance with a single fixed rate.
|
static IborRateStubCalculation |
ofIborInterpolatedRate(IborIndex index1,
IborIndex index2)
Obtains an instance with linear interpolation of two floating rates.
|
static IborRateStubCalculation |
ofIborRate(IborIndex index)
Obtains an instance with a single floating rate.
|
static IborRateStubCalculation |
ofKnownAmount(CurrencyAmount knownAmount)
Obtains an instance with a known amount of interest.
|
IborRateStubCalculation.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
public static final IborRateStubCalculation NONE
public static IborRateStubCalculation ofFixedRate(double fixedRate)
fixedRate - the fixed rate for the stubpublic static IborRateStubCalculation ofKnownAmount(CurrencyAmount knownAmount)
knownAmount - the known amount of interestpublic static IborRateStubCalculation ofIborRate(IborIndex index)
index - the index that applies to the stubIllegalArgumentException - if the index is nullpublic static IborRateStubCalculation ofIborInterpolatedRate(IborIndex index1, IborIndex index2)
The two indices must be different, typically with one longer than another. The order of input of the indices does not matter.
index1 - the first indexindex2 - the second indexIllegalArgumentException - if the two indices are the same or either is nullpublic boolean isFixedRate()
public boolean isKnownAmount()
public boolean isFloatingRate()
public boolean isInterpolated()
An interpolated rate exists when there are two different rates that need linear interpolation.
public static IborRateStubCalculation.Meta meta()
IborRateStubCalculation.public static IborRateStubCalculation.Builder builder()
public IborRateStubCalculation.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic OptionalDouble getFixedRate()
In certain circumstances two counterparties agree a fixed rate for the stub. It is used in place of an observed fixing. Other calculation elements, such as gearing or spread, still apply.
If the fixed rate is present, then knownAmount, index and
indexInterpolated must not be present.
public Optional<CurrencyAmount> getKnownAmount()
If the known amount is present, then fixedRate, index and
indexInterpolated must not be present.
public Optional<IborIndex> getIndex()
This will be used throughout the stub unless indexInterpolated is present.
If the index is present, then fixedRate and knownAmount must not be present.
public Optional<IborIndex> getIndexInterpolated()
This will be used with index to linearly interpolate the rate.
This index may be shorter or longer than index, but not the same.
If the interpolated index is present, then index must also be present,
and fixedRate and knownAmount must not be present.
public IborRateStubCalculation.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.