Package com.opengamma.strata.calc.runner
Class ResultsListener
- java.lang.Object
-
- com.opengamma.strata.calc.runner.AggregatingCalculationListener<Results>
-
- com.opengamma.strata.calc.runner.ResultsListener
-
- All Implemented Interfaces:
CalculationListener
public final class ResultsListener extends AggregatingCalculationListener<Results>
Calculation listener that receives the results of individual calculations and builds a set ofResults
.
-
-
Constructor Summary
Constructors Constructor Description ResultsListener()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculationsStarted(List<CalculationTarget> targets, List<Column> columns)
Invoked when the calculations start; guaranteed to be invoked beforeCalculationListener.resultReceived(CalculationTarget, CalculationResult)
andCalculationListener.calculationsComplete()
.protected Results
createAggregateResult()
Invoked to create the aggregate result when the individual calculations are complete.void
resultReceived(CalculationTarget target, CalculationResult result)
Invoked when a calculation completes.-
Methods inherited from class com.opengamma.strata.calc.runner.AggregatingCalculationListener
calculationsComplete, getFuture, result
-
-
-
-
Method Detail
-
calculationsStarted
public void calculationsStarted(List<CalculationTarget> targets, List<Column> columns)
Description copied from interface:CalculationListener
Invoked when the calculations start; guaranteed to be invoked beforeCalculationListener.resultReceived(CalculationTarget, CalculationResult)
andCalculationListener.calculationsComplete()
.- Parameters:
targets
- the targets for which values are being calculated; these are often tradescolumns
- the columns for which values are being calculated
-
resultReceived
public void resultReceived(CalculationTarget target, CalculationResult result)
Description copied from interface:CalculationListener
Invoked when a calculation completes.It is guaranteed that
CalculationListener.calculationsStarted(List, List)
will be called before this method and that this method will never be called afterCalculationListener.calculationsComplete()
.It is possible that this method will never be called. This can happen if an empty list of targets is passed to the calculation runner.
- Specified by:
resultReceived
in interfaceCalculationListener
- Specified by:
resultReceived
in classAggregatingCalculationListener<Results>
- Parameters:
target
- the calculation target, such as a traderesult
- the result of the calculation
-
createAggregateResult
protected Results createAggregateResult()
Description copied from class:AggregatingCalculationListener
Invoked to create the aggregate result when the individual calculations are complete.This is guaranteed to be invoked after all results have been passed to
AggregatingCalculationListener.resultReceived(com.opengamma.strata.basics.CalculationTarget, com.opengamma.strata.calc.runner.CalculationResult)
.- Specified by:
createAggregateResult
in classAggregatingCalculationListener<Results>
- Returns:
- the aggregate result of all the calculations
-
-