Class AbstractCollector

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearSavedData()
      Should clear the saved data from the array
      int getId()  
      java.lang.String getName()  
      double[] getSavedData()
      Returns a copy of the data saved while the saved data option was turned on, will return null if no data were collected
      boolean getSaveOption()
      Indicates whether or not the save data option is on true = on, false = off
      void save​(double x)
      Used to save data to an array.
      void save​(double[] values)
      Saves all values in the array
      void setArraySizeIncrement​(int n)
      Controls the amount that the saved data array will grow by after it has been filled up.
      void setName​(java.lang.String str)
      Sets the name
      void setSaveOption​(boolean flag)
      Sets the save data option true = on, false = off If true, the data will be saved to an array If this option is toggled, then only the data when the option is true will be saved.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractCollector

        public AbstractCollector()
      • AbstractCollector

        public AbstractCollector​(java.lang.String name)
        Parameters:
        name - the name of the collector
    • Method Detail

      • getName

        public final java.lang.String getName()
        Specified by:
        getName in interface GetNameIfc
        Returns:
        a string representing the name of the object
      • setName

        public final void setName​(java.lang.String str)
        Sets the name
        Parameters:
        str - The name as a string.
      • getId

        public final int getId()
        Specified by:
        getId in interface IdentityIfc
        Returns:
        an int representing the id of the object
      • getSaveOption

        public final boolean getSaveOption()
        Description copied from interface: ArraySaverIfc
        Indicates whether or not the save data option is on true = on, false = off
        Specified by:
        getSaveOption in interface ArraySaverIfc
        Returns:
        true if save option is on
      • save

        public final void save​(double x)
        Description copied from interface: ArraySaverIfc
        Used to save data to an array. This method should not save anything unless the save option is on.
        Specified by:
        save in interface ArraySaverIfc
        Parameters:
        x - the data to save to the array
      • save

        public final void save​(double[] values)
        Description copied from interface: ArraySaverIfc
        Saves all values in the array
        Specified by:
        save in interface ArraySaverIfc
        Parameters:
        values - the values to save
      • getSavedData

        public final double[] getSavedData()
        Description copied from interface: ArraySaverIfc
        Returns a copy of the data saved while the saved data option was turned on, will return null if no data were collected
        Specified by:
        getSavedData in interface ArraySaverIfc
        Returns:
        the array of data
      • setArraySizeIncrement

        public final void setArraySizeIncrement​(int n)
        Description copied from interface: ArraySaverIfc
        Controls the amount that the saved data array will grow by after it has been filled up. If the potential number of data points is known, then this method can be used so that arrays do not have to be copied during collection The array size will start at this value and then increment by this value whenever full
        Specified by:
        setArraySizeIncrement in interface ArraySaverIfc
        Parameters:
        n - the growth increment
      • setSaveOption

        public final void setSaveOption​(boolean flag)
        Description copied from interface: ArraySaverIfc
        Sets the save data option true = on, false = off If true, the data will be saved to an array If this option is toggled, then only the data when the option is true will be saved.
        Specified by:
        setSaveOption in interface ArraySaverIfc
        Parameters:
        flag - true means save the data
      • clearSavedData

        public final void clearSavedData()
        Description copied from interface: ArraySaverIfc
        Should clear the saved data from the array
        Specified by:
        clearSavedData in interface ArraySaverIfc