Package jsl.utilities

Class DataObservableArray

    • Field Detail

      • myValues

        protected double[] myValues
      • myCurrentIndex

        protected int myCurrentIndex
    • Constructor Detail

      • DataObservableArray

        public DataObservableArray​(double[] values)
        Parameters:
        values -
      • DataObservableArray

        public DataObservableArray​(double[] values,
                                   java.lang.String name)
        Parameters:
        values -
        name -
      • DataObservableArray

        public DataObservableArray​(double[] values,
                                   int n,
                                   java.lang.String name)
        Parameters:
        values -
        n -
        name -
    • Method Detail

      • next

        public double next()
        Description copied from class: IterativeDataObservable
        Advances to the next value and returns it. Implementers must use setValue(double value) to properly set the current value. getValue() should then return this current value until advanced again Should throw a NoSuchElementException if there is no next value
        Specified by:
        next in class IterativeDataObservable
        Returns:
      • reset

        public void reset()
        Description copied from class: IterativeDataObservable
        This method should reset the IterativeDataSource so that it is positioned just prior to the 1st value to be returned via the use of the next() method Implementers should ensure that observers are notified of the reset and that the end of source indicator correctly reflects the reset
        Specified by:
        reset in class IterativeDataObservable
      • size

        public int size()
        The size of the array
        Returns:
      • getValue

        public double getValue​(int i)
        Returns the value at index i zero indexed
        Parameters:
        i -
        Returns:
      • setValues

        protected void setValues​(double[] values,
                                 int n)
      • toString

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