public class DispatchingRateComputationFn extends Object implements RateComputationFn<RateComputation>
Dispatches the request to the correct implementation.
| Modifier and Type | Field and Description |
|---|---|
static DispatchingRateComputationFn |
DEFAULT
Default implementation.
|
| Modifier and Type | Method and Description |
|---|---|
double |
explainRate(RateComputation computation,
LocalDate startDate,
LocalDate endDate,
RatesProvider provider,
ExplainMapBuilder builder)
Explains the calculation of the applicable rate.
|
double |
rate(RateComputation computation,
LocalDate startDate,
LocalDate endDate,
RatesProvider provider)
Determines the applicable rate for the computation.
|
PointSensitivityBuilder |
rateSensitivity(RateComputation computation,
LocalDate startDate,
LocalDate endDate,
RatesProvider provider)
Determines the point sensitivity for the rate computation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstandardpublic static final DispatchingRateComputationFn DEFAULT
public DispatchingRateComputationFn(RateComputationFn<IborRateComputation> iborRateComputationFn, RateComputationFn<IborInterpolatedRateComputation> iborInterpolatedRateComputationFn, RateComputationFn<IborAveragedRateComputation> iborAveragedRateComputationFn, RateComputationFn<OvernightCompoundedRateComputation> overnightCompoundedRateComputationFn, RateComputationFn<OvernightCompoundedAnnualRateComputation> overnightCompundedAnnualRateComputationFn, RateComputationFn<OvernightAveragedRateComputation> overnightAveragedRateComputationFn, RateComputationFn<OvernightAveragedDailyRateComputation> overnightAveragedDailyRateComputationFn, RateComputationFn<InflationMonthlyRateComputation> inflationMonthlyRateComputationFn, RateComputationFn<InflationInterpolatedRateComputation> inflationInterpolatedRateComputationFn, RateComputationFn<InflationEndMonthRateComputation> inflationEndMonthRateComputationFn, RateComputationFn<InflationEndInterpolatedRateComputation> inflationEndInterpolatedRateComputationFn)
iborRateComputationFn - the rate provider for IborRateComputationiborInterpolatedRateComputationFn - the rate computation for IborInterpolatedRateComputationiborAveragedRateComputationFn - the rate computation for IborAveragedRateComputationovernightCompoundedRateComputationFn - the rate computation for OvernightCompoundedRateComputationovernightCompundedAnnualRateComputationFn - the rate computation for OvernightCompoundedAnnualRateComputationovernightAveragedRateComputationFn - the rate computation for OvernightAveragedRateComputationovernightAveragedDailyRateComputationFn - the rate computation for OvernightAveragedDailyRateComputationinflationMonthlyRateComputationFn - the rate computation for InflationMonthlyRateComputationinflationInterpolatedRateComputationFn - the rate computation for InflationInterpolatedRateComputationinflationEndMonthRateComputationFn - the rate computation for InflationEndMonthRateComputationinflationEndInterpolatedRateComputationFn - the rate computation for InflationEndInterpolatedRateComputationpublic double rate(RateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
RateComputationFn
Each type of rate has specific rules, encapsulated in RateComputation.
The start date and end date refer to the accrual period. In many cases, this information is not necessary, however it does enable some implementations that would not otherwise be possible.
rate in interface RateComputationFn<RateComputation>computation - the computation definitionstartDate - the start date of the accrual periodendDate - the end date of the accrual periodprovider - the rates providerpublic PointSensitivityBuilder rateSensitivity(RateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
RateComputationFnThis returns a sensitivity instance referring to the curves used to determine each forward rate.
rateSensitivity in interface RateComputationFn<RateComputation>computation - the computation definitionstartDate - the start date of the accrual periodendDate - the end date of the accrual periodprovider - the rates providerpublic double explainRate(RateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider, ExplainMapBuilder builder)
RateComputationFn
This adds information to the ExplainMapBuilder to aid understanding of the computation.
The actual rate is also returned.
explainRate in interface RateComputationFn<RateComputation>computation - the computation definitionstartDate - the start date of the accrual periodendDate - the end date of the accrual periodprovider - the rates providerbuilder - the builder to populateCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.