Class DispatchingSwapPaymentPeriodPricer
- java.lang.Object
 - 
- com.opengamma.strata.pricer.impl.swap.DispatchingSwapPaymentPeriodPricer
 
 
- 
- All Implemented Interfaces:
 SwapPaymentPeriodPricer<SwapPaymentPeriod>
public class DispatchingSwapPaymentPeriodPricer extends Object implements SwapPaymentPeriodPricer<SwapPaymentPeriod>
Pricer implementation for payment periods using multiple dispatch.Dispatches the request to the correct implementation.
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static DispatchingSwapPaymentPeriodPricerDEFAULTDefault implementation. 
- 
Constructor Summary
Constructors Constructor Description DispatchingSwapPaymentPeriodPricer(SwapPaymentPeriodPricer<RatePaymentPeriod> ratePaymentPeriodPricer, SwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod> knownAmountPaymentPeriodPricer)Creates an instance. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleaccruedInterest(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the accrued interest since the last payment.MultiCurrencyAmountcurrencyExposure(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the currency exposure of a single payment period.doublecurrentCash(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the current cash of a single payment period.voidexplainPresentValue(SwapPaymentPeriod paymentPeriod, RatesProvider provider, ExplainMapBuilder builder)Explains the present value of a single payment period.doubleforecastValue(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the forecast value of a single payment period.PointSensitivityBuilderforecastValueSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the forecast value sensitivity of a single payment period.doublepresentValue(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the present value of a single payment period.PointSensitivityBuilderpresentValueSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the present value sensitivity of a single payment period.doublepvbp(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the present value of a basis point of a period.PointSensitivityBuilderpvbpSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider)Calculates the present value of a basis point sensitivity of a single payment period. 
 - 
 
- 
- 
Field Detail
- 
DEFAULT
public static final DispatchingSwapPaymentPeriodPricer DEFAULT
Default implementation. 
 - 
 
- 
Constructor Detail
- 
DispatchingSwapPaymentPeriodPricer
public DispatchingSwapPaymentPeriodPricer(SwapPaymentPeriodPricer<RatePaymentPeriod> ratePaymentPeriodPricer, SwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod> knownAmountPaymentPeriodPricer)
Creates an instance.- Parameters:
 ratePaymentPeriodPricer- the pricer forRatePaymentPeriodknownAmountPaymentPeriodPricer- the pricer forKnownAmountSwapPaymentPeriod
 
 - 
 
- 
Method Detail
- 
presentValue
public double presentValue(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the present value of a single payment period.The amount is expressed in the currency of the period. This returns the value of the period with discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
- Specified by:
 presentValuein interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the present value of the period
 
 
- 
presentValueSensitivity
public PointSensitivityBuilder presentValueSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the present value sensitivity of a single payment period.The present value sensitivity of the period is the sensitivity of the present value to the underlying curves.
- Specified by:
 presentValueSensitivityin interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the present value curve sensitivity of the period
 
 
- 
forecastValue
public double forecastValue(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the forecast value of a single payment period.The amount is expressed in the currency of the period. This returns the value of the period without discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
- Specified by:
 forecastValuein interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the forecast value of the period
 
 
- 
forecastValueSensitivity
public PointSensitivityBuilder forecastValueSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the forecast value sensitivity of a single payment period.The forecast value sensitivity of the period is the sensitivity of the forecast value to the underlying curves.
- Specified by:
 forecastValueSensitivityin interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the forecast value curve sensitivity of the period
 
 
- 
pvbp
public double pvbp(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the present value of a basis point of a period.This calculate the amount by which, to the first order, the period present value changes for a change of the rate defining the payment period. For known amount payments for which there is rate, the value is 0. In absence of compounding on the period, this measure is equivalent to the traditional PVBP.
- Specified by:
 pvbpin interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the present value of a basis point
 
 
- 
pvbpSensitivity
public PointSensitivityBuilder pvbpSensitivity(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the present value of a basis point sensitivity of a single payment period.This calculate the sensitivity of the present value of a basis point (pvbp) quantity to the underlying curves.
- Specified by:
 pvbpSensitivityin interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the present value of a basis point sensitivity
 
 
- 
accruedInterest
public double accruedInterest(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the accrued interest since the last payment.This calculates the interest that has accrued between the start of the period and the valuation date. Discounting is not applied. The amount is expressed in the currency of the period. It is intended that this method is called only with the period where the valuation date is after the start date and before or equal to the end date.
- Specified by:
 accruedInterestin interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the accrued interest of the period
 
 
- 
explainPresentValue
public void explainPresentValue(SwapPaymentPeriod paymentPeriod, RatesProvider provider, ExplainMapBuilder builder)
Description copied from interface:SwapPaymentPeriodPricerExplains the present value of a single payment period.This adds information to the
ExplainMapBuilderto aid understanding of the calculation.- Specified by:
 explainPresentValuein interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates providerbuilder- the builder to populate
 
- 
currencyExposure
public MultiCurrencyAmount currencyExposure(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the currency exposure of a single payment period.- Specified by:
 currencyExposurein interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the currency exposure
 
 
- 
currentCash
public double currentCash(SwapPaymentPeriod paymentPeriod, RatesProvider provider)
Description copied from interface:SwapPaymentPeriodPricerCalculates the current cash of a single payment period.- Specified by:
 currentCashin interfaceSwapPaymentPeriodPricer<SwapPaymentPeriod>- Parameters:
 paymentPeriod- the periodprovider- the rates provider- Returns:
 - the current cash
 
 
 - 
 
 -