Class MultiChannelTimeSeriesAggregator<I,CI,O,D,T>
java.lang.Object
de.iip_ecosphere.platform.kiServices.functions.aggregation.MultiChannelTimeSeriesAggregator<I,CI,O,D,T>
- Type Parameters:
I- the input data typeCI- the contained input data type in <I>, may be the same as <I> for single-data-point aggregationO- the output data typeD- the data point type withinIandOT- the timestamp type withinIandO
- Direct Known Subclasses:
ChannelTimeSeriesAggregator
Generic multi-data-point time series aggregator for identified channels.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents the data format independent access to aggregation data for single data points.static classIterator for arrays.static interfaceDetermines whether an aggregation chunk is completed.static classBasic aggregation function delegating the operations to (lambda) functions.static interfaceBuilds a result from multiple category/data entries.static classAn iterator over a single value. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMultiChannelTimeSeriesAggregator(boolean isAggregating, MultiChannelTimeSeriesAggregator.AggregationFunction<I, CI, O, D, T> function) Creates a new instance for single data points.MultiChannelTimeSeriesAggregator(boolean isAggregating, MultiChannelTimeSeriesAggregator.AggregationFunction<I, CI, O, D, T> function, Function<I, Iterator<CI>> iteratorProvider) Creates a new instance for single data points.MultiChannelTimeSeriesAggregator(MultiChannelTimeSeriesAggregator.AggregationFunction<I, CI, O, D, T> function) Creates a not-yet-aggregating instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether aggregation is enabled.Called to process the input.protected OProcesses a single data item.voidStarts the aggregation.voidStops the aggregation and clears the data structures.
-
Field Details
-
isAggregating
private boolean isAggregating -
aggregationTimestamp
-
numberAggregatedSamples
private int numberAggregatedSamples -
timePointAggregator
-
timeSeriesAggregator
-
function
-
iteratorProvider
-
-
Constructor Details
-
MultiChannelTimeSeriesAggregator
public MultiChannelTimeSeriesAggregator(MultiChannelTimeSeriesAggregator.AggregationFunction<I, CI, O, D, T> function) Creates a not-yet-aggregating instance.- Parameters:
function- the aggreation function- Throws:
IllegalArgumentException- iffunctionis not given
-
MultiChannelTimeSeriesAggregator
public MultiChannelTimeSeriesAggregator(boolean isAggregating, MultiChannelTimeSeriesAggregator.AggregationFunction<I, CI, O, D, T> function, Function<I, Iterator<CI>> iteratorProvider) Creates a new instance for single data points.- Parameters:
isAggregating- whether aggregation shall start immediatelyfunction- the aggregation functioniteratorProvider- function creating an iterator from <I> over <CI>, may be null for none- Throws:
IllegalArgumentException- iffunctionis not given
-
MultiChannelTimeSeriesAggregator
public MultiChannelTimeSeriesAggregator(boolean isAggregating, MultiChannelTimeSeriesAggregator.AggregationFunction<I, CI, O, D, T> function) Creates a new instance for single data points.- Parameters:
isAggregating- whether aggregation shall start immediatelyfunction- the aggregation function- Throws:
IllegalArgumentException- iffunctionis not given
-
-
Method Details
-
isAggregating
public boolean isAggregating()Returns whether aggregation is enabled.- Returns:
truefor enabled,falseelse
-
process
Called to process the input.- Parameters:
data- the data to process- Returns:
- the aggregated data, may be null for none at this point in time
-
process
Processes a single data item.- Parameters:
parent- the parent data item holdingdata, may be identical todatadata- the data item- Returns:
- the aggregated data, may be null for none at this point in time
-
startAggregating
public void startAggregating()Starts the aggregation. -
stopAggregating
public void stopAggregating()Stops the aggregation and clears the data structures.
-