Class DispatchingSwapPaymentEventPricer
- java.lang.Object
- 
- com.opengamma.strata.pricer.impl.swap.DispatchingSwapPaymentEventPricer
 
- 
- All Implemented Interfaces:
- SwapPaymentEventPricer<SwapPaymentEvent>
 
 public class DispatchingSwapPaymentEventPricer extends Object implements SwapPaymentEventPricer<SwapPaymentEvent> Pricer implementation for payment events using multiple dispatch.Dispatches the request to the correct implementation. 
- 
- 
Field SummaryFields Modifier and Type Field Description static DispatchingSwapPaymentEventPricerDEFAULTDefault implementation.
 - 
Constructor SummaryConstructors Constructor Description DispatchingSwapPaymentEventPricer(SwapPaymentEventPricer<NotionalExchange> notionalExchangePricer, SwapPaymentEventPricer<FxResetNotionalExchange> fxResetNotionalExchangePricer)Creates an instance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmountcurrencyExposure(SwapPaymentEvent paymentEvent, RatesProvider provider)Calculates the currency exposure of a single payment event.doublecurrentCash(SwapPaymentEvent paymentEvent, RatesProvider provider)Calculates the current cash of a single payment event.voidexplainPresentValue(SwapPaymentEvent paymentEvent, RatesProvider provider, ExplainMapBuilder builder)Explains the present value of a single payment event.doubleforecastValue(SwapPaymentEvent paymentEvent, RatesProvider provider)Calculates the forecast value of a single payment event.PointSensitivityBuilderforecastValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider)Calculates the forecast value sensitivity of a single payment event.doublepresentValue(SwapPaymentEvent paymentEvent, RatesProvider provider)Calculates the present value of a single payment event.PointSensitivityBuilderpresentValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider)Calculates the present value sensitivity of a single payment event.
 
- 
- 
- 
Field Detail- 
DEFAULTpublic static final DispatchingSwapPaymentEventPricer DEFAULT Default implementation.
 
- 
 - 
Constructor Detail- 
DispatchingSwapPaymentEventPricerpublic DispatchingSwapPaymentEventPricer(SwapPaymentEventPricer<NotionalExchange> notionalExchangePricer, SwapPaymentEventPricer<FxResetNotionalExchange> fxResetNotionalExchangePricer) Creates an instance.- Parameters:
- notionalExchangePricer- the pricer for- NotionalExchange
- fxResetNotionalExchangePricer- the pricer for- FxResetNotionalExchange
 
 
- 
 - 
Method Detail- 
presentValuepublic double presentValue(SwapPaymentEvent paymentEvent, RatesProvider provider) Description copied from interface:SwapPaymentEventPricerCalculates the present value of a single payment event.The amount is expressed in the currency of the event. This returns the value of the event with discounting. The payment date of the event should not be in the past. The result of this method for payment dates in the past is undefined. - Specified by:
- presentValuein interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- Returns:
- the present value of the event
 
 - 
presentValueSensitivitypublic PointSensitivityBuilder presentValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider) Description copied from interface:SwapPaymentEventPricerCalculates the present value sensitivity of a single payment event.The present value sensitivity of the event is the sensitivity of the present value to the underlying curves. - Specified by:
- presentValueSensitivityin interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- Returns:
- the present value curve sensitivity of the event
 
 - 
forecastValuepublic double forecastValue(SwapPaymentEvent paymentEvent, RatesProvider provider) Description copied from interface:SwapPaymentEventPricerCalculates the forecast value of a single payment event.The amount is expressed in the currency of the event. This returns the value of the event without discounting. The payment date of the event should not be in the past. The result of this method for payment dates in the past is undefined. - Specified by:
- forecastValuein interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- Returns:
- the forecast value of the event
 
 - 
forecastValueSensitivitypublic PointSensitivityBuilder forecastValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider) Description copied from interface:SwapPaymentEventPricerCalculates the forecast value sensitivity of a single payment event.The forecast value sensitivity of the event is the sensitivity of the forecast value to the underlying curves. - Specified by:
- forecastValueSensitivityin interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- Returns:
- the forecast value curve sensitivity of the event
 
 - 
explainPresentValuepublic void explainPresentValue(SwapPaymentEvent paymentEvent, RatesProvider provider, ExplainMapBuilder builder) Description copied from interface:SwapPaymentEventPricerExplains the present value of a single payment event.This adds information to the ExplainMapBuilderto aid understanding of the calculation.- Specified by:
- explainPresentValuein interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- builder- the builder to populate
 
 - 
currencyExposurepublic MultiCurrencyAmount currencyExposure(SwapPaymentEvent paymentEvent, RatesProvider provider) Description copied from interface:SwapPaymentEventPricerCalculates the currency exposure of a single payment event.- Specified by:
- currencyExposurein interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- Returns:
- the currency exposure
 
 - 
currentCashpublic double currentCash(SwapPaymentEvent paymentEvent, RatesProvider provider) Description copied from interface:SwapPaymentEventPricerCalculates the current cash of a single payment event.- Specified by:
- currentCashin interface- SwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
- paymentEvent- the event
- provider- the rates provider
- Returns:
- the current cash
 
 
- 
 
-