Class 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 one 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.

    See Also:
    Serialized Form
    • 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 elements
        valueFunction - the function used to obtain each value
        Returns:
        an instance initialized using the function
        Throws:
        IllegalArgumentException - is size is zero or less
      • get

        public Double get​(int index)
        Description copied from interface: ScenarioArray
        Gets the value at the specified scenario index.
        Specified by:
        get in interface ScenarioArray<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: ScenarioArray
        Returns a stream of the values.

        The stream will return the value for each scenario.

        Specified by:
        stream in interface ScenarioArray<Double>
        Returns:
        a stream of the values
      • meta

        public static DoubleScenarioArray.Meta meta()
        The meta-bean for DoubleScenarioArray.
        Returns:
        the meta-bean, not null
      • getValues

        public DoubleArray getValues()
        Gets the calculated values, one per scenario.
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object