public final class DoubleScenarioArray extends Object implements ScenarioArray<Double>, org.joda.beans.ImmutableBean, Serializable
double
value for each scenario.
This contains a list of values, one value for each scenario. The calculation runner will not attempt to convert the currency of the values.
Modifier and Type | Class and Description |
---|---|
static class |
DoubleScenarioArray.Meta
The meta-bean for
DoubleScenarioArray . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Double |
get(int index)
Gets the value at the specified scenario index.
|
int |
getScenarioCount()
Gets the number of scenarios.
|
DoubleArray |
getValues()
Gets the calculated values, one per scenario.
|
int |
hashCode() |
static DoubleScenarioArray.Meta |
meta()
The meta-bean for
DoubleScenarioArray . |
DoubleScenarioArray.Meta |
metaBean() |
static DoubleScenarioArray |
of(DoubleArray values)
Obtains an instance from the specified array of values.
|
static DoubleScenarioArray |
of(int size,
IntToDoubleFunction valueFunction)
Obtains an instance using a function to create the entries.
|
static DoubleScenarioArray |
of(List<Double> values)
Obtains an instance from the specified list of values.
|
Stream<Double> |
stream()
Returns a stream of the values.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
of, of, of, ofSingleValue
public static DoubleScenarioArray of(DoubleArray values)
values
- the values, one value for each scenariopublic static DoubleScenarioArray of(List<Double> values)
values
- the values, one value for each scenariopublic static DoubleScenarioArray of(int size, IntToDoubleFunction valueFunction)
The function is passed the scenario index and returns the value for that index.
size
- the number of elementsvalueFunction
- the function used to obtain each valueIllegalArgumentException
- is size is zero or lesspublic int getScenarioCount()
ScenarioArray
getScenarioCount
in interface ScenarioArray<Double>
public Double get(int index)
ScenarioArray
get
in interface ScenarioArray<Double>
index
- the zero-based index of the scenariopublic Stream<Double> stream()
ScenarioArray
The stream will return the value for each scenario.
stream
in interface ScenarioArray<Double>
public static DoubleScenarioArray.Meta meta()
DoubleScenarioArray
.public DoubleScenarioArray.Meta metaBean()
metaBean
in interface org.joda.beans.Bean
public DoubleArray getValues()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.