Class CalculationTasks
- java.lang.Object
-
- com.opengamma.strata.calc.runner.CalculationTasks
-
- All Implemented Interfaces:
org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class CalculationTasks extends Object implements org.joda.beans.ImmutableBean
The tasks that will be used to perform the calculations.This captures the targets, columns and tasks that define the result grid. Each task can be executed to produce the result. Applications will typically use
CalculationRunner
orCalculationTaskRunner
to execute the tasks.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
List<Column>
getColumns()
Gets the columns that will be calculated.List<CalculationTarget>
getTargets()
Gets the targets that calculations will be performed on.List<CalculationTask>
getTasks()
Gets the tasks that perform the individual calculations.int
hashCode()
static org.joda.beans.TypedMetaBean<CalculationTasks>
meta()
The meta-bean forCalculationTasks
.org.joda.beans.TypedMetaBean<CalculationTasks>
metaBean()
static CalculationTasks
of(CalculationRules rules, List<? extends CalculationTarget> targets, List<Column> columns)
Obtains an instance from a set of targets, columns and rules.static CalculationTasks
of(CalculationRules rules, List<? extends CalculationTarget> targets, List<Column> columns, ReferenceData refData)
Obtains an instance from a set of targets, columns and rules, resolving the targets.static CalculationTasks
of(List<CalculationTask> tasks, List<Column> columns)
Obtains an instance from a set of tasks and columns.MarketDataRequirements
requirements(ReferenceData refData)
Gets the market data that is required to perform the calculations.String
toString()
-
-
-
Method Detail
-
of
public static CalculationTasks of(CalculationRules rules, List<? extends CalculationTarget> targets, List<Column> columns)
Obtains an instance from a set of targets, columns and rules.The targets will typically be trades. The columns represent the measures to calculate.
Any target that implements
ResolvableCalculationTarget
will result in a failed task.- Parameters:
rules
- the rules defining how the calculation is performedtargets
- the targets for which values of the measures will be calculatedcolumns
- the columns that will be calculated- Returns:
- the calculation tasks
-
of
public static CalculationTasks of(CalculationRules rules, List<? extends CalculationTarget> targets, List<Column> columns, ReferenceData refData)
Obtains an instance from a set of targets, columns and rules, resolving the targets.The targets will typically be trades and positions. The columns represent the measures to calculate.
The targets will be resolved if they implement
ResolvableCalculationTarget
.- Parameters:
rules
- the rules defining how the calculation is performedtargets
- the targets for which values of the measures will be calculatedcolumns
- the columns that will be calculatedrefData
- the reference data to use to resolve the targets- Returns:
- the calculation tasks
-
of
public static CalculationTasks of(List<CalculationTask> tasks, List<Column> columns)
Obtains an instance from a set of tasks and columns.- Parameters:
tasks
- the tasks that perform the calculationscolumns
- the columns that define the calculations- Returns:
- the calculation tasks
-
requirements
public MarketDataRequirements requirements(ReferenceData refData)
Gets the market data that is required to perform the calculations.This can be used to pass into the market data system to obtain and calibrate data.
- Parameters:
refData
- the reference data- Returns:
- the market data required for all calculations
- Throws:
RuntimeException
- if unable to obtain the requirements
-
meta
public static org.joda.beans.TypedMetaBean<CalculationTasks> meta()
The meta-bean forCalculationTasks
.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.TypedMetaBean<CalculationTasks> metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getTargets
public List<CalculationTarget> getTargets()
Gets the targets that calculations will be performed on.The result of the calculations will be a grid where each row is taken from this list.
- Returns:
- the value of the property, not empty
-
getColumns
public List<Column> getColumns()
Gets the columns that will be calculated.The result of the calculations will be a grid where each column is taken from this list.
- Returns:
- the value of the property, not empty
-
getTasks
public List<CalculationTask> getTasks()
Gets the tasks that perform the individual calculations.The results can be visualized as a grid, with a row for each target and a column for each measure. Each task can calculate the result for one or more cells in the grid.
- Returns:
- the value of the property, not empty
-
-