Package jsl.utilities

Class IterativeDataObservable

    • Field Detail

      • RESET

        public static final int RESET
        An "enum" to indicate that this iterative data source has just been reset to observers Subclasses are responsible for using notifyObservers(RESET) to let observers know that a reset has been done.
      • END_SOURCE

        public static final int END_SOURCE
        An "enum" to indicate that this iterative data source has just reached it's end Subclasses are responsible for using notifyObservers(END_SOURCE) to let observers know that the end of the source has been reached
      • myEndSourceFlag

        protected boolean myEndSourceFlag
        Indicates that the end of the source has been reached. Should be used by subclasses to indicate end of source
    • Constructor Detail

      • IterativeDataObservable

        public IterativeDataObservable()
      • IterativeDataObservable

        public IterativeDataObservable​(java.lang.String name)
        Parameters:
        name -
    • Method Detail

      • getEndSourceFlag

        public boolean getEndSourceFlag()
        Indicates that the end of the source has been reached.
        Returns:
      • hasNext

        public abstract boolean hasNext()
        Indicates to clients whether there is another value after the current value for the data source
        Returns:
      • next

        public abstract double next()
        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
        Returns:
      • reset

        public abstract void reset()
        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