public class SwapLeg extends AbstractAnalyticProduct implements AnalyticProduct, DescribedProduct<InterestRateSwapLegProductDescriptor>, Serializable
Schedule.| Constructor and Description |
|---|
SwapLeg(LocalDateTime cashFlowEffectiveDate,
Schedule legSchedule,
String forwardCurveName,
double[] notionals,
double[] spreads,
String discountCurveName,
boolean isNotionalExchanged)
Creates a swap leg.
|
SwapLeg(Optional<LocalDateTime> cashFlowEffectiveDate,
Schedule legSchedule,
String forwardCurveName,
double[] notionals,
double[] spreads,
String discountCurveName,
boolean isNotionalExchanged)
Deprecated.
|
SwapLeg(Optional<LocalDateTime> cashFlowEffectiveDate,
Schedule legSchedule,
String forwardCurveName,
double spread,
String discountCurveName)
Creates a swap leg without notional reset and without notional exchange.
|
SwapLeg(Optional<LocalDateTime> cashFlowEffectiveDate,
Schedule legSchedule,
String forwardCurveName,
double spread,
String discountCurveName,
String discountCurveForNotionalResetName,
boolean isNotionalExchanged)
Creates a swap leg.
|
SwapLeg(Schedule legSchedule,
String forwardCurveName,
double[] notionals,
double[] spreads,
String discountCurveName,
boolean isNotionalExchanged)
Creates a swap leg.
|
SwapLeg(Schedule legSchedule,
String forwardCurveName,
double spread,
String discountCurveName)
Creates a swap leg without notional reset and without notional exchange.
|
SwapLeg(Schedule legSchedule,
String forwardCurveName,
double spread,
String discountCurveName,
boolean isNotionalExchanged)
Creates a swap leg without notional reset.
|
SwapLeg(Schedule legSchedule,
String forwardCurveName,
double spread,
String discountCurveName,
String discountCurveForNotionalResetName,
boolean isNotionalExchanged)
Creates a swap leg.
|
| Modifier and Type | Method and Description |
|---|---|
InterestRateSwapLegProductDescriptor |
getDescriptor()
Return a product descriptor representing this product.
|
String |
getDiscountCurveName() |
String |
getForwardCurveName() |
Schedule |
getSchedule() |
double |
getSpread()
Returns the constant spread, , if the spread of this leg is constant.
|
double[] |
getSpreads() |
double |
getValue(double evaluationTime,
AnalyticModel model)
Return the valuation of the product using the given model.
|
boolean |
isNotionalExchanged() |
String |
toString() |
getValue, getValuepublic SwapLeg(LocalDateTime cashFlowEffectiveDate, Schedule legSchedule, String forwardCurveName, double[] notionals, double[] spreads, String discountCurveName, boolean isNotionalExchanged)
cashFlowEffectiveDate - If present, cash-flows are effective after this date, otherwise cash-flows are effective after the valuation date.legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.notionals - Array of notionals for each period.spreads - Array of fixed spreads on the forward or fix rate for each period.discountCurveName - Name of the discount curve for the leg.isNotionalExchanged - If true, the leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).@Deprecated public SwapLeg(Optional<LocalDateTime> cashFlowEffectiveDate, Schedule legSchedule, String forwardCurveName, double[] notionals, double[] spreads, String discountCurveName, boolean isNotionalExchanged)
cashFlowEffectiveDate - If present, cash-flows are effective after this date, otherwise cash-flows are effective after the valuation date.legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.notionals - Array of notionals for each period.spreads - Array of fixed spreads on the forward or fix rate for each period.discountCurveName - Name of the discount curve for the leg.isNotionalExchanged - If true, the leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).public SwapLeg(Schedule legSchedule, String forwardCurveName, double[] notionals, double[] spreads, String discountCurveName, boolean isNotionalExchanged)
legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.notionals - Array of notionals for each period.spreads - Array of fixed spreads on the forward or fix rate for each period.discountCurveName - Name of the discount curve for the leg.isNotionalExchanged - If true, the leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).public SwapLeg(Optional<LocalDateTime> cashFlowEffectiveDate, Schedule legSchedule, String forwardCurveName, double spread, String discountCurveName, String discountCurveForNotionalResetName, boolean isNotionalExchanged)
cashFlowEffectiveDate - If present, cash-flows are effective after this date, otherwise cash-flows are effective after the valuation date.legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.spread - Fixed spread on the forward or fix rate.discountCurveName - Name of the discount curve for the leg.discountCurveForNotionalResetName - Name of the discount curve used for notional reset. If it is left empty or equal to discountCurveName then there is no notional reset.isNotionalExchanged - If true, the leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).public SwapLeg(Schedule legSchedule, String forwardCurveName, double spread, String discountCurveName, String discountCurveForNotionalResetName, boolean isNotionalExchanged)
legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.spread - Fixed spread on the forward or fix rate.discountCurveName - Name of the discount curve for the leg.discountCurveForNotionalResetName - Name of the discount curve used for notional reset. If it is left empty or equal to discountCurveName then there is no notional reset.isNotionalExchanged - If true, the leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).public SwapLeg(Schedule legSchedule, String forwardCurveName, double spread, String discountCurveName, boolean isNotionalExchanged)
legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.spread - Fixed spread on the forward or fix rate.discountCurveName - Name of the discount curve for the leg.isNotionalExchanged - If true, the leg will pay notional at the beginning of each swap period and receive notional at the end of the swap period. Note that the cash flow date for the notional is periodStart and periodEnd (not fixingDate and paymentDate).public SwapLeg(Optional<LocalDateTime> cashFlowEffectiveDate, Schedule legSchedule, String forwardCurveName, double spread, String discountCurveName)
cashFlowEffectiveDate - If present, cash-flows are effective after this date, otherwise cash-flows are effective after the valuation date.legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.spread - Fixed spread on the forward or fix rate.discountCurveName - Name of the discount curve for the leg.public SwapLeg(Schedule legSchedule, String forwardCurveName, double spread, String discountCurveName)
legSchedule - ScheduleFromPeriods of the leg.forwardCurveName - Name of the forward curve, leave empty if this is a fix leg.spread - Fixed spread on the forward or fix rate.discountCurveName - Name of the discount curve for the leg.public double getValue(double evaluationTime,
AnalyticModel model)
AnalyticProductAnalyticModel.getValue in interface AnalyticProductevaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.model - The model under which the product is valued.public Schedule getSchedule()
public String getForwardCurveName()
public double[] getSpreads()
public double getSpread()
UnsupportedOperationException is thrown.public String getDiscountCurveName()
public boolean isNotionalExchanged()
public InterestRateSwapLegProductDescriptor getDescriptor()
DescribedProductgetDescriptor in interface DescribedProduct<InterestRateSwapLegProductDescriptor>Copyright © 2019. All rights reserved.