Class QuoteScenarioArray

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

    public final class QuoteScenarioArray
    extends java.lang.Object
    implements ScenarioArray<java.lang.Double>, ImmutableBean,
    Container for values for an item of quoted market data in multiple scenarios.

    This class is a more efficient alternative to storing quotes using MarketDataBox.ofScenarioValues or ScenarioValuesList.

    It stores the quote values in a primitive double array which reduces memory footprint and avoids the overhead of boxing.

    For maximum performance functions can access the array of quotes without boxing or copying via the quotes property. Functions should use a QuoteScenarioArrayId to request a QuotesArray from the market data container if they need direct access to the array of quotes.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static QuoteScenarioArray of​(DoubleArray quotes)
        Obtains an instance wrapping a set of quotes.
        quotes - the quotes
        an instance wrapping a set of quotes
      • getScenarioCount

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

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

        public<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>
        a stream of the values
      • meta

        public static QuoteScenarioArray.Meta meta()
        The meta-bean for QuoteScenarioArray.
        the meta-bean, not null
      • getQuotes

        public DoubleArray getQuotes()
        Gets the values of the quotes.
        the value of the property, not null
      • equals

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

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

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