public final class CalculationResult extends Object implements org.joda.beans.ImmutableBean, Serializable
This stores the calculated result for a single cell in the output grid.
A set of related results for a single target can be stored in a CalculationResults instance.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getColumnIndex()
Gets the column index of the value in the results grid.
|
Result<?> |
getResult()
Gets the result of the calculation.
|
<T> Result<T> |
getResult(Class<T> type)
Gets the result of the calculation, casting the result to a known type.
|
int |
getRowIndex()
Gets the row index of the value in the results grid.
|
int |
hashCode() |
static org.joda.beans.TypedMetaBean<CalculationResult> |
meta()
The meta-bean for
CalculationResult. |
org.joda.beans.TypedMetaBean<CalculationResult> |
metaBean() |
static CalculationResult |
of(int rowIndex,
int columnIndex,
Result<?> result)
Obtains an instance for the specified row and column index in the output grid.
|
String |
toString() |
CalculationResult |
withResult(Result<?> underlyingResult)
Returns a copy of this result with the underlying result updated.
|
public static CalculationResult of(int rowIndex, int columnIndex, Result<?> result)
The Result object captures the result value, or the failure that
prevented the result from being calculated.
rowIndex - the row index of the value in the results gridcolumnIndex - the column index of the value in the results gridresult - the result of the calculationpublic <T> Result<T> getResult(Class<T> type)
The result may be a single value or a multi-scenario value.
A multi-scenario value will implement ScenarioArray unless it has been aggregated.
If the calculation did not complete successfully, a failure result will be returned explaining the problem. Callers must check whether the result is a success or failure before examining the result value.
T - the result typetype - the result typeClassCastException - if the result is not of the specified typepublic CalculationResult withResult(Result<?> underlyingResult)
underlyingResult - the new underlying resultpublic static org.joda.beans.TypedMetaBean<CalculationResult> meta()
CalculationResult.public org.joda.beans.TypedMetaBean<CalculationResult> metaBean()
metaBean in interface org.joda.beans.Beanpublic int getRowIndex()
public int getColumnIndex()
public Result<?> getResult()
The result may be a single value or a multi-scenario value.
A multi-scenario value will implement ScenarioArray unless it has been aggregated.
If the calculation did not complete successfully, a failure result will be returned explaining the problem. Callers must check whether the result is a success or failure before examining the result value.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.