Class DoubleScenarioArray

  • All Implemented Interfaces:
    ScenarioArray<java.lang.Double>, java.io.Serializable, Bean, ImmutableBean

    public final class DoubleScenarioArray
    extends java.lang.Object
    implements ScenarioArray<java.lang.Double>, ImmutableBean, java.io.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​(java.util.List<java.lang.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,
                                             java.util.function.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:
        java.lang.IllegalArgumentException - is size is zero or less
      • getScenarioCount

        public int getScenarioCount()
        Description copied from interface: ScenarioArray
        Gets the number of scenarios.
        Specified by:
        getScenarioCount in interface ScenarioArray<java.lang.Double>
        Returns:
        the number of scenarios
      • get

        public java.lang.Double get​(int index)
        Description copied from interface: ScenarioArray
        Gets the value at the specified scenario index.
        Specified by:
        get in interface ScenarioArray<java.lang.Double>
        Parameters:
        index - the zero-based index of the scenario
        Returns:
        the value at the specified index
      • stream

        public java.util.stream.Stream<java.lang.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<java.lang.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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object