public final class CalculationTask extends Object implements org.joda.beans.ImmutableBean
This is a single unit of execution in the calculation runner.
It consists of a CalculationFunction and the appropriate inputs,
including a single CalculationTarget. When invoked, it will
calculate a result for one or more columns in the grid of results.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
CalculationResults |
execute(ScenarioMarketData marketData,
ReferenceData refData)
Executes the task, performing calculations for the target using multiple sets of market data.
|
List<CalculationTaskCell> |
getCells()
Gets the cells to be calculated.
|
CalculationFunction<CalculationTarget> |
getFunction()
Gets the function that will calculate the value.
|
Set<Measure> |
getMeasures()
Gets the set of measures that will be calculated by this task.
|
CalculationParameters |
getParameters()
Gets the additional parameters.
|
int |
getRowIndex()
Gets the index of the row in the grid of results.
|
CalculationTarget |
getTarget()
Gets the target for which the value will be calculated.
|
int |
hashCode() |
static org.joda.beans.TypedMetaBean<CalculationTask> |
meta()
The meta-bean for
CalculationTask. |
org.joda.beans.TypedMetaBean<CalculationTask> |
metaBean() |
Currency |
naturalCurrency(ReferenceData refData)
Determines the natural currency of the target.
|
static CalculationTask |
of(CalculationTarget target,
CalculationFunction<? extends CalculationTarget> function,
CalculationParameters parameters,
List<CalculationTaskCell> cells)
Obtains an instance that will calculate the specified cells.
|
static CalculationTask |
of(CalculationTarget target,
CalculationFunction<? extends CalculationTarget> function,
CalculationTaskCell... cells)
Obtains an instance that will calculate the specified cells.
|
MarketDataRequirements |
requirements(ReferenceData refData)
Returns requirements specifying the market data the function needs to perform its calculations.
|
String |
toString() |
public static CalculationTask of(CalculationTarget target, CalculationFunction<? extends CalculationTarget> function, CalculationTaskCell... cells)
The cells must all be for the same row index and none of the column indices must overlap. The result will contain no calculation parameters.
target - the target for which the value will be calculatedfunction - the function that performs the calculationcells - the cells to be calculated by this taskpublic static CalculationTask of(CalculationTarget target, CalculationFunction<? extends CalculationTarget> function, CalculationParameters parameters, List<CalculationTaskCell> cells)
The cells must all be for the same row index and none of the column indices must overlap.
target - the target for which the value will be calculatedfunction - the function that performs the calculationparameters - the additional parameterscells - the cells to be calculated by this taskpublic int getRowIndex()
public Set<Measure> getMeasures()
public MarketDataRequirements requirements(ReferenceData refData)
refData - the reference datapublic Currency naturalCurrency(ReferenceData refData)
This is only called for measures that are currency convertible.
refData - the reference datapublic CalculationResults execute(ScenarioMarketData marketData, ReferenceData refData)
This invokes the function with the correct set of market data.
marketData - the market data used in the calculationrefData - the reference datapublic static org.joda.beans.TypedMetaBean<CalculationTask> meta()
CalculationTask.public org.joda.beans.TypedMetaBean<CalculationTask> metaBean()
metaBean in interface org.joda.beans.Beanpublic CalculationTarget getTarget()
public CalculationFunction<CalculationTarget> getFunction()
public CalculationParameters getParameters()
public List<CalculationTaskCell> getCells()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.