DataPipe
, DataPipeForked
, IDataSink
, IDataSource
public class AccumulatorAverageBlockless extends DataAccumulator
This accumulator accepts any type of Data
Modifier and Type | Class | Description |
---|---|---|
static class |
AccumulatorAverageBlockless.AllData |
|
static class |
AccumulatorAverageBlockless.StatType |
Enumerated type that can be used to indicated the statistic to be taken
from the accumulator (e.g., average, error, current value, etc.).
|
Modifier and Type | Field | Description |
---|---|---|
protected IData |
average |
|
static AccumulatorAverageBlockless.StatType |
AVERAGE |
|
protected long |
count |
|
protected DataGroup |
dataGroup |
|
static AccumulatorAverageBlockless.StatType |
MOST_RECENT |
|
protected IData |
mostRecent |
|
protected IFunction |
negativeChop |
|
static AccumulatorAverageBlockless.StatType |
STANDARD_DEVIATION |
|
protected IData |
standardDeviation |
|
protected IData |
sum |
|
protected IData |
sumSquare |
|
protected IData |
work |
active, hasUnpushedData, pushInterval, putCount
dataInfo, dataSink, tag
Constructor | Description |
---|---|
AccumulatorAverageBlockless() |
Default constructor sets block size to Default value, and sets the
interval for pushing the output data (pushInterval) to 100.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
addData(IData data) |
Add the given values to the sums and block sums.
|
void |
addDataSink(IDataSink newDataSink,
AccumulatorAverageBlockless.StatType[] types) |
Adds a new DataSink that will receive a specific subset of the statistics
generated by this accumulator.
|
IData |
getData() |
Returns a DataGroup with Data instances holding the statistics kept by
this accumulator (as described in general comments for this class).
|
AccumulatorAverageBlockless.AllData |
getRawData() |
|
long |
getSampleCount() |
|
DataTag |
getTag(AccumulatorAverageBlockless.StatType statType) |
|
IDataInfo |
processDataInfo(IDataInfo incomingDataInfo) |
Prepares the accumulator for input data.
|
void |
reset() |
Resets all sums to zero.
|
void |
setRawData(AccumulatorAverageBlockless.AllData ad) |
|
static AccumulatorAverageBlockless.StatType[] |
statChoices() |
getPushInterval, isActive, processData, setActive, setPushInterval, toString
getDataInfo, getTag, putData, putDataInfo
addDataSink, getDataSink, getDataSinks, removeDataSink, setDataSink, setDataSinks
putData, putDataInfo
getDataInfo, getTag
public static final AccumulatorAverageBlockless.StatType MOST_RECENT
public static final AccumulatorAverageBlockless.StatType AVERAGE
public static final AccumulatorAverageBlockless.StatType STANDARD_DEVIATION
protected final IFunction negativeChop
protected IData mostRecent
protected IData average
protected IData standardDeviation
protected DataGroup dataGroup
protected long count
protected IData sum
protected IData sumSquare
protected IData work
public AccumulatorAverageBlockless()
public static AccumulatorAverageBlockless.StatType[] statChoices()
public DataTag getTag(AccumulatorAverageBlockless.StatType statType)
public boolean addData(IData data)
addData
in class DataAccumulator
data
- the data to be processedpublic IData getData()
getData
in interface IDataSource
getData
in class DataAccumulator
public void reset()
reset
in class DataAccumulator
public IDataInfo processDataInfo(IDataInfo incomingDataInfo)
processDataInfo
in class DataProcessor
incomingDataInfo
- the DataInfo instance for the data that will be given to
addDatapublic void addDataSink(IDataSink newDataSink, AccumulatorAverageBlockless.StatType[] types)
newDataSink
- the new DataSinktypes
- array indicating the statistics to be included in the
DataGroup sent to the sink.public long getSampleCount()
public AccumulatorAverageBlockless.AllData getRawData()
public void setRawData(AccumulatorAverageBlockless.AllData ad)