com.opengamma.strata.calc.runner

• All Implemented Interfaces:
Bean, ImmutableBean

public final class CalculationTasks
extends Object
implements 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 or CalculationTaskRunner to execute the tasks.

• ### Method Summary

All Methods
Modifier and Type Method and 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 TypedMetaBean<CalculationTasks> meta()
The meta-bean for CalculationTasks.
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()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• ### 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 performed
targets - the targets for which values of the measures will be calculated
columns - the columns that will be calculated
Returns:
• #### 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 performed
targets - the targets for which values of the measures will be calculated
columns - the columns that will be calculated
refData - the reference data to use to resolve the targets
Returns:
• #### 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 calculations
columns - the columns that define the calculations
Returns:
• #### 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
• #### toString

public String toString()
Overrides:
toString in class Object
• #### meta

public static TypedMetaBean<CalculationTasks> meta()
The meta-bean for CalculationTasks.
Returns:
the meta-bean, not null
• #### metaBean

public TypedMetaBean<CalculationTasks> metaBean()
Specified by:
metaBean in interface 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

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
• #### equals

public boolean equals(Object obj)
Overrides:
equals in class Object
• #### hashCode

public int hashCode()
Overrides:
hashCode in class Object