Package jsl.utilities.statistic
Interface ArraySaverIfc
-
- All Known Implementing Classes:
AbstractCollector
,AbstractStatistic
,AntitheticStatistic
,ArraySaver
,BatchStatistic
,CachedHistogram
,ExceedanceEstimator
,Histogram
,StandardizedTimeSeriesStatistic
,Statistic
public interface ArraySaverIfc
An interface to define the behavior of saving data to an array
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DATA_ARRAY_SIZE
The default increment for the array size
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
clearSavedData()
Should clear the saved data from the arraydouble[]
getSavedData()
Returns a copy of the data saved while the saved data option was turned on, will return null if no data were collectedboolean
getSaveOption()
Indicates whether or not the save data option is on true = on, false = offvoid
save(double x)
Used to save data to an array.default void
save(double[] values)
Saves all values in the arrayvoid
setArraySizeIncrement(int n)
Controls the amount that the saved data array will grow by after it has been filled up.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.
-
-
-
Field Detail
-
DEFAULT_DATA_ARRAY_SIZE
static final int DEFAULT_DATA_ARRAY_SIZE
The default increment for the array size- See Also:
- Constant Field Values
-
-
Method Detail
-
getSaveOption
boolean getSaveOption()
Indicates whether or not the save data option is on true = on, false = off- Returns:
- true if save option is on
-
save
void save(double x)
Used to save data to an array. This method should not save anything unless the save option is on.- Parameters:
x
- the data to save to the array
-
save
default void save(double[] values)
Saves all values in the array- Parameters:
values
- the values to save
-
getSavedData
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- Returns:
- the array of data
-
setArraySizeIncrement
void setArraySizeIncrement(int n)
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- Parameters:
n
- the growth increment
-
setSaveOption
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.- Parameters:
flag
- true means save the data
-
clearSavedData
void clearSavedData()
Should clear the saved data from the array
-
-