public final class KnownAmountSwapLeg extends Object implements ScheduledSwapLeg, org.joda.beans.ImmutableBean, Serializable
Most fixed swap legs are calculated based on a fixed rate of interest. By contrast, this leg defines a known payment amount for each period.
Each payment occurs relative to a payment period. The payment periods are calculated relative to the accrual periods. While the model allows the frequency of the accrual and payment periods to differ, this will have no effect, as the amounts to be paid at each payment date are known. This design is intended to match FpML.
| Modifier and Type | Class and Description |
|---|---|
static class |
KnownAmountSwapLeg.Builder
The bean-builder for
KnownAmountSwapLeg. |
static class |
KnownAmountSwapLeg.Meta
The meta-bean for
KnownAmountSwapLeg. |
| Modifier and Type | Method and Description |
|---|---|
static KnownAmountSwapLeg.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
void |
collectCurrencies(ImmutableSet.Builder<Currency> builder)
Collects all the currencies referred to by this leg.
|
void |
collectIndices(ImmutableSet.Builder<Index> builder)
Collects all the indices referred to by this leg.
|
boolean |
equals(Object obj) |
PeriodicSchedule |
getAccrualSchedule()
Gets the accrual period schedule.
|
ValueSchedule |
getAmount()
Gets the known amount schedule.
|
Currency |
getCurrency()
Gets the currency of the swap leg.
|
AdjustableDate |
getEndDate()
Gets the accrual end date of the leg.
|
PaymentSchedule |
getPaymentSchedule()
Gets the payment period schedule.
|
PayReceive |
getPayReceive()
Gets whether the leg is pay or receive.
|
AdjustableDate |
getStartDate()
Gets the accrual start date of the leg.
|
SwapLegType |
getType()
Gets the type of the leg, such as Fixed or Ibor.
|
int |
hashCode() |
static KnownAmountSwapLeg.Meta |
meta()
The meta-bean for
KnownAmountSwapLeg. |
KnownAmountSwapLeg.Meta |
metaBean() |
KnownAmountSwapLeg |
replaceStartDate(LocalDate adjustedStartDate)
Returns an instance based on this leg with the start date replaced.
|
ResolvedSwapLeg |
resolve(ReferenceData refData)
Converts this swap leg to the equivalent
ResolvedSwapLeg. |
KnownAmountSwapLeg.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitallCurrencies, allIndicespublic SwapLegType getType()
SwapLegThis provides a high level categorization of the swap leg.
public AdjustableDate getStartDate()
SwapLegThis is the first accrual date in the leg, often known as the effective date.
Defined as the effective date by the 2006 ISDA definitions article 3.2.
getStartDate in interface SwapLegpublic AdjustableDate getEndDate()
SwapLegThis is the last accrual date in the leg, often known as the termination date.
Defined as the termination date by the 2006 ISDA definitions article 3.3.
getEndDate in interface SwapLegpublic void collectCurrencies(ImmutableSet.Builder<Currency> builder)
SwapLegThis collects the complete set of currencies for the leg, not just the payment currencies.
collectCurrencies in interface SwapLegbuilder - the builder to populatepublic void collectIndices(ImmutableSet.Builder<Index> builder)
SwapLegA swap leg will typically refer to at least one index, such as 'GBP-LIBOR-3M'. Each index that is referred to must be added to the specified builder.
collectIndices in interface SwapLegbuilder - the builder to populatepublic KnownAmountSwapLeg replaceStartDate(LocalDate adjustedStartDate)
This uses PeriodicSchedule.replaceStartDate(LocalDate).
replaceStartDate in interface SwapLegadjustedStartDate - the new adjusted start dateIllegalArgumentException - if the start date cannot be replaced with the proposed start datepublic ResolvedSwapLeg resolve(ReferenceData refData)
ResolvedSwapLeg.
An ResolvedSwapLeg represents the same data as this leg, but with
a complete schedule of dates defined using KnownAmountSwapPaymentPeriod.
resolve in interface Resolvable<ResolvedSwapLeg>resolve in interface SwapLegrefData - the reference data to use when resolvingReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataRuntimeException - if unable to resolve due to an invalid swap schedule or definitionpublic static KnownAmountSwapLeg.Meta meta()
KnownAmountSwapLeg.public static KnownAmountSwapLeg.Builder builder()
public KnownAmountSwapLeg.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic PayReceive getPayReceive()
A value of 'Pay' implies that the resulting amount is paid to the counterparty. A value of 'Receive' implies that the resulting amount is received from the counterparty. Note that negative interest rates can result in a payment in the opposite direction to that implied by this indicator.
getPayReceive in interface SwapLegpublic PeriodicSchedule getAccrualSchedule()
This is used to define the accrual periods. These are used directly or indirectly to determine other dates in the swap.
getAccrualSchedule in interface ScheduledSwapLegpublic PaymentSchedule getPaymentSchedule()
This is used to define the payment periods, including any compounding. The payment period dates are based on the accrual schedule.
getPaymentSchedule in interface ScheduledSwapLegpublic ValueSchedule getAmount()
This defines the schedule of known amounts, relative to the payment schedule. The schedule is defined as an initial amount, with optional changes during the tenor of the swap. The amount is only permitted to change at payment period boundaries.
Note that the date of the payment is implied by the payment schedule. Any dates in the known amount schedule refer to the payment schedule, not the payment date.
For example, consider a two year swap where each payment period is 3 months long.
This schedule could define two entries, one that defines the payment amounts as GBP 1000 for
the first year and one that defines the amount as GBP 500 for the second year.
In this case there will be eight payments in total, four payments of GBP 1000 in the first
year and four payments of GBP 500 in the second year.
Each payment will occur on the date specified using the offset in PaymentSchedule.
public Currency getCurrency()
This is the currency of the known payments.
getCurrency in interface SwapLegpublic KnownAmountSwapLeg.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.