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 Summary
Fields Modifier and Type Field Description static DispatchingSwapPaymentEventPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DispatchingSwapPaymentEventPricer(SwapPaymentEventPricer<NotionalExchange> notionalExchangePricer, SwapPaymentEventPricer<FxResetNotionalExchange> fxResetNotionalExchangePricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(SwapPaymentEvent paymentEvent, RatesProvider provider)
Calculates the currency exposure of a single payment event.double
currentCash(SwapPaymentEvent paymentEvent, RatesProvider provider)
Calculates the current cash of a single payment event.void
explainPresentValue(SwapPaymentEvent paymentEvent, RatesProvider provider, ExplainMapBuilder builder)
Explains the present value of a single payment event.double
forecastValue(SwapPaymentEvent paymentEvent, RatesProvider provider)
Calculates the forecast value of a single payment event.PointSensitivityBuilder
forecastValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider)
Calculates the forecast value sensitivity of a single payment event.double
presentValue(SwapPaymentEvent paymentEvent, RatesProvider provider)
Calculates the present value of a single payment event.PointSensitivityBuilder
presentValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider)
Calculates the present value sensitivity of a single payment event.
-
-
-
Field Detail
-
DEFAULT
public static final DispatchingSwapPaymentEventPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DispatchingSwapPaymentEventPricer
public DispatchingSwapPaymentEventPricer(SwapPaymentEventPricer<NotionalExchange> notionalExchangePricer, SwapPaymentEventPricer<FxResetNotionalExchange> fxResetNotionalExchangePricer)
Creates an instance.- Parameters:
notionalExchangePricer
- the pricer forNotionalExchange
fxResetNotionalExchangePricer
- the pricer forFxResetNotionalExchange
-
-
Method Detail
-
presentValue
public double presentValue(SwapPaymentEvent paymentEvent, RatesProvider provider)
Description copied from interface:SwapPaymentEventPricer
Calculates 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:
presentValue
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates provider- Returns:
- the present value of the event
-
presentValueSensitivity
public PointSensitivityBuilder presentValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider)
Description copied from interface:SwapPaymentEventPricer
Calculates 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:
presentValueSensitivity
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates provider- Returns:
- the present value curve sensitivity of the event
-
forecastValue
public double forecastValue(SwapPaymentEvent paymentEvent, RatesProvider provider)
Description copied from interface:SwapPaymentEventPricer
Calculates 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:
forecastValue
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates provider- Returns:
- the forecast value of the event
-
forecastValueSensitivity
public PointSensitivityBuilder forecastValueSensitivity(SwapPaymentEvent paymentEvent, RatesProvider provider)
Description copied from interface:SwapPaymentEventPricer
Calculates 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:
forecastValueSensitivity
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates provider- Returns:
- the forecast value curve sensitivity of the event
-
explainPresentValue
public void explainPresentValue(SwapPaymentEvent paymentEvent, RatesProvider provider, ExplainMapBuilder builder)
Description copied from interface:SwapPaymentEventPricer
Explains the present value of a single payment event.This adds information to the
ExplainMapBuilder
to aid understanding of the calculation.- Specified by:
explainPresentValue
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates providerbuilder
- the builder to populate
-
currencyExposure
public MultiCurrencyAmount currencyExposure(SwapPaymentEvent paymentEvent, RatesProvider provider)
Description copied from interface:SwapPaymentEventPricer
Calculates the currency exposure of a single payment event.- Specified by:
currencyExposure
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates provider- Returns:
- the currency exposure
-
currentCash
public double currentCash(SwapPaymentEvent paymentEvent, RatesProvider provider)
Description copied from interface:SwapPaymentEventPricer
Calculates the current cash of a single payment event.- Specified by:
currentCash
in interfaceSwapPaymentEventPricer<SwapPaymentEvent>
- Parameters:
paymentEvent
- the eventprovider
- the rates provider- Returns:
- the current cash
-
-