Object -
streams :
Sum
Aggregator to perform summation of values in a stream.
Methods
Updates the current sum of numeric values based on the eventType
. If the eventType
is streams:CURRENT
,
value
is added to the current sum. If the eventType
is streams:EXPIRED
, value
is subtracted from the
current sum. If the eventType
is streams:RESET
, Current summation will be reset, regardless the value
.
Returns a copy of the Sum
aggregator without its current state.
Return current state to be saved as a map of any
typed values.
Restores the saved state which is passed as a map of any
typed values.
Fields
Updates the current sum of numeric values based on the eventType
. If the eventType
is streams:CURRENT
,
value
is added to the current sum. If the eventType
is streams:EXPIRED
, value
is subtracted from the
current sum. If the eventType
is streams:RESET
, Current summation will be reset, regardless the value
.
Parameters
- value anydata
-
The numeric value being aggregated to the current sum.
- eventType EventType
-
Type of the incoming event
streams:CURRENT
,streams:EXPIRED
orstreams:RESET
.
-
Return Type
(anydata) aggregated summation after the given
value
.
Returns a copy of the Sum
aggregator without its current state.
-
Return Type
(Aggregator) Returns
Sum
aggregator.
Return current state to be saved as a map of any
typed values.
-
Return Type
(map) A map of
any
typed values.
Restores the saved state which is passed as a map of any
typed values.
Parameters
- state map
-
A map of typed
any
values. This map contains the values to be restored from the persisted data.