Class DoubleScenarioArray
- java.lang.Object
-
- com.opengamma.strata.data.scenario.DoubleScenarioArray
-
- All Implemented Interfaces:
ScenarioArray<Double>,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class DoubleScenarioArray extends Object implements ScenarioArray<Double>, org.joda.beans.ImmutableBean, Serializable
A scenario array holding onedoublevalue 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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDoubleScenarioArray.MetaThe meta-bean forDoubleScenarioArray.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Doubleget(int index)Gets the value at the specified scenario index.intgetScenarioCount()Gets the number of scenarios.DoubleArraygetValues()Gets the calculated values, one per scenario.inthashCode()static DoubleScenarioArray.Metameta()The meta-bean forDoubleScenarioArray.DoubleScenarioArray.MetametaBean()static DoubleScenarioArrayof(int size, IntToDoubleFunction valueFunction)Obtains an instance using a function to create the entries.static DoubleScenarioArrayof(DoubleArray values)Obtains an instance from the specified array of values.static DoubleScenarioArrayof(List<Double> values)Obtains an instance from the specified list of values.Stream<Double>stream()Returns a stream of the values.StringtoString()
-
-
-
Method Detail
-
of
public static DoubleScenarioArray of(DoubleArray values)
Obtains an instance from the specified array of values.- Parameters:
values- the values, one value for each scenario- Returns:
- an instance with the specified values
-
of
public static DoubleScenarioArray of(List<Double> values)
Obtains an instance from the specified list of values.- Parameters:
values- the values, one value for each scenario- Returns:
- an instance with the specified values
-
of
public static DoubleScenarioArray of(int size, IntToDoubleFunction valueFunction)
Obtains an instance using a function to create the entries.The function is passed the scenario index and returns the value for that index.
- Parameters:
size- the number of elementsvalueFunction- the function used to obtain each value- Returns:
- an instance initialized using the function
- Throws:
IllegalArgumentException- is size is zero or less
-
getScenarioCount
public int getScenarioCount()
Description copied from interface:ScenarioArrayGets the number of scenarios.- Specified by:
getScenarioCountin interfaceScenarioArray<Double>- Returns:
- the number of scenarios
-
get
public Double get(int index)
Description copied from interface:ScenarioArrayGets the value at the specified scenario index.- Specified by:
getin interfaceScenarioArray<Double>- Parameters:
index- the zero-based index of the scenario- Returns:
- the value at the specified index
-
stream
public Stream<Double> stream()
Description copied from interface:ScenarioArrayReturns a stream of the values.The stream will return the value for each scenario.
- Specified by:
streamin interfaceScenarioArray<Double>- Returns:
- a stream of the values
-
meta
public static DoubleScenarioArray.Meta meta()
The meta-bean forDoubleScenarioArray.- Returns:
- the meta-bean, not null
-
metaBean
public DoubleScenarioArray.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getValues
public DoubleArray getValues()
Gets the calculated values, one per scenario.- Returns:
- the value of the property, not null
-
-