Package com.opengamma.strata.calc.runner
Class AbstractDerivedCalculationFunction<T extends CalculationTarget,R>
- java.lang.Object
-
- com.opengamma.strata.calc.runner.AbstractDerivedCalculationFunction<T,R>
-
- Type Parameters:
T- the type of calculation target handled by the functionR- the type of the measure calculated by the function
- All Implemented Interfaces:
DerivedCalculationFunction<T,R>
public abstract class AbstractDerivedCalculationFunction<T extends CalculationTarget,R> extends Object implements DerivedCalculationFunction<T,R>
Abstract derived calculation function with fields for the target type, measure and required measures.Empty requirements are returned from
requirements(T, com.opengamma.strata.calc.runner.CalculationParameters, com.opengamma.strata.basics.ReferenceData). Subtypes only need to provide an implementation of theDerivedCalculationFunction.calculate(T, java.util.Map<com.opengamma.strata.calc.Measure, java.lang.Object>, com.opengamma.strata.calc.runner.CalculationParameters, com.opengamma.strata.data.scenario.ScenarioMarketData, com.opengamma.strata.basics.ReferenceData)method.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDerivedCalculationFunction(Class<T> targetType, Measure measure, Measure... requiredMeasures)Creates a new function which calculates one measure for targets of one type.protectedAbstractDerivedCalculationFunction(Class<T> targetType, Measure measure, Set<Measure> requiredMeasures)Creates a new function which calculates one measure for targets of one type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Measuremeasure()Returns the measure calculated by the function.Set<Measure>requiredMeasures()Returns the measures required by this function to calculate its measure.FunctionRequirementsrequirements(T target, CalculationParameters parameters, ReferenceData refData)Returns requirements for the market data required by this function to calculate its measure.Class<T>targetType()Returns the type of calculation target handled by the function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.calc.runner.DerivedCalculationFunction
calculate
-
-
-
-
Constructor Detail
-
AbstractDerivedCalculationFunction
protected AbstractDerivedCalculationFunction(Class<T> targetType, Measure measure, Measure... requiredMeasures)
Creates a new function which calculates one measure for targets of one type.- Parameters:
targetType- the target type handled by the function, often a trademeasure- the measure calculated by the functionrequiredMeasures- the measures required as inputs to the calculation
-
AbstractDerivedCalculationFunction
protected AbstractDerivedCalculationFunction(Class<T> targetType, Measure measure, Set<Measure> requiredMeasures)
Creates a new function which calculates one measure for targets of one type.- Parameters:
targetType- the target type handled by the function, often a trademeasure- the measure calculated by the functionrequiredMeasures- the measures required as inputs to the calculation
-
-
Method Detail
-
targetType
public Class<T> targetType()
Description copied from interface:DerivedCalculationFunctionReturns the type of calculation target handled by the function.- Specified by:
targetTypein interfaceDerivedCalculationFunction<T extends CalculationTarget,R>- Returns:
- the type of calculation target handled by the function
-
measure
public Measure measure()
Description copied from interface:DerivedCalculationFunctionReturns the measure calculated by the function.- Specified by:
measurein interfaceDerivedCalculationFunction<T extends CalculationTarget,R>- Returns:
- the measure calculated by the function
-
requiredMeasures
public Set<Measure> requiredMeasures()
Description copied from interface:DerivedCalculationFunctionReturns the measures required by this function to calculate its measure.- Specified by:
requiredMeasuresin interfaceDerivedCalculationFunction<T extends CalculationTarget,R>- Returns:
- the measures required by this function to calculate its measure
-
requirements
public FunctionRequirements requirements(T target, CalculationParameters parameters, ReferenceData refData)
Description copied from interface:DerivedCalculationFunctionReturns requirements for the market data required by this function to calculate its measure.- Specified by:
requirementsin interfaceDerivedCalculationFunction<T extends CalculationTarget,R>- Parameters:
target- the target of the calculation, often a tradeparameters- the calculation parameters specifying how the calculations should be performedrefData- the reference data used in the calculations- Returns:
- requirements for the market data required by this function to calculate its measure
-
-