Interface RateComputationFn<T extends RateComputation>
-
- Type Parameters:
T
- the type of rate to be observed
- All Known Implementing Classes:
ApproxForwardOvernightAveragedRateComputationFn
,DispatchingRateComputationFn
,ForwardIborAveragedRateComputationFn
,ForwardIborInterpolatedRateComputationFn
,ForwardIborRateComputationFn
,ForwardInflationEndInterpolatedRateComputationFn
,ForwardInflationEndMonthRateComputationFn
,ForwardInflationInterpolatedRateComputationFn
,ForwardInflationMonthlyRateComputationFn
,ForwardOvernightAveragedDailyRateComputationFn
,ForwardOvernightAveragedRateComputationFn
,ForwardOvernightCompoundedAnnualRateComputationFn
,ForwardOvernightCompoundedRateComputationFn
public interface RateComputationFn<T extends RateComputation>
Computes a rate.This function provides the ability to compute a rate defined by
RateComputation
. The rate will be based on known historic data and forward curves.Implementations must be immutable and thread-safe functions.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description double
explainRate(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider, ExplainMapBuilder builder)
Explains the calculation of the applicable rate.double
rate(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Determines the applicable rate for the computation.PointSensitivityBuilder
rateSensitivity(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Determines the point sensitivity for the rate computation.static RateComputationFn<RateComputation>
standard()
Returns the standard instance of the function.
-
-
-
Method Detail
-
standard
static RateComputationFn<RateComputation> standard()
Returns the standard instance of the function.Use this method to avoid a direct dependency on the implementation.
- Returns:
- the rate computation function
-
rate
double rate(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Determines the applicable rate for the computation.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.
- Parameters:
computation
- the computation definitionstartDate
- the start date of the accrual periodendDate
- the end date of the accrual periodprovider
- the rates provider- Returns:
- the applicable rate
-
rateSensitivity
PointSensitivityBuilder rateSensitivity(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Determines the point sensitivity for the rate computation.This returns a sensitivity instance referring to the curves used to determine each forward rate.
- Parameters:
computation
- the computation definitionstartDate
- the start date of the accrual periodendDate
- the end date of the accrual periodprovider
- the rates provider- Returns:
- the point sensitivity
-
explainRate
double explainRate(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider, ExplainMapBuilder builder)
Explains the calculation of the applicable rate.This adds information to the
ExplainMapBuilder
to aid understanding of the computation. The actual rate is also returned.- Parameters:
computation
- the computation definitionstartDate
- the start date of the accrual periodendDate
- the end date of the accrual periodprovider
- the rates providerbuilder
- the builder to populate- Returns:
- the applicable rate
-
-