Class CalculationTasks

  • All Implemented Interfaces:
    Bean, ImmutableBean

    public final class CalculationTasks
    extends java.lang.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 Detail

      • of

        public static CalculationTasks of​(CalculationRules rules,
                                          java.util.List<? extends CalculationTarget> targets,
                                          java.util.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:
        the calculation tasks
      • of

        public static CalculationTasks of​(CalculationRules rules,
                                          java.util.List<? extends CalculationTarget> targets,
                                          java.util.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:
        the calculation tasks
      • of

        public static CalculationTasks of​(java.util.List<CalculationTask> tasks,
                                          java.util.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:
        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:
        java.lang.RuntimeException - if unable to obtain the requirements
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getTargets

        public java.util.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 java.util.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 java.util.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​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object