net.esper.eql.core
Interface Aggregator

All Known Implementing Classes:
ExprAvedevNode.DoubleAvedev, ExprAvgNode.DoubleAvg, ExprCountNode.DatapointAggregator, ExprCountNode.NonNullDatapointAggregator, ExprMedianNode.DoubleMedian, ExprMinMaxAggrNode.MinMaxAggregator, ExprStddevNode.DoubleStddev, ExprSumNode.DoubleSum, ExprSumNode.FloatSum, ExprSumNode.IntegerSum, ExprSumNode.LongSum, ExprSumNode.NumberIntegerSum, UniqueValueAggregator

public interface Aggregator

Maintains aggregation state applying values as entering and leaving the state.

Implementations must also act as a factory for further independent copies of aggregation states such that new aggregation state holders and be created from a prototype.


Method Summary
 void enter(java.lang.Object value)
          Apply the value as entering aggregation (entering window).
 java.lang.Object getValue()
          Returns the current value held.
 java.lang.Class getValueType()
          Returns the type of the current value.
 void leave(java.lang.Object value)
          Apply the value as leaving aggregation (leaving window).
 Aggregator newAggregator()
          Make a new, initalized aggregation state.
 

Method Detail

enter

void enter(java.lang.Object value)
Apply the value as entering aggregation (entering window).

The value can be null since 'null' values may be counted as unique separate values.

Parameters:
value - to add to aggregate

leave

void leave(java.lang.Object value)
Apply the value as leaving aggregation (leaving window).

The value can be null since 'null' values may be counted as unique separate values.

Parameters:
value - to remove from aggregate

getValue

java.lang.Object getValue()
Returns the current value held.

Returns:
current value

getValueType

java.lang.Class getValueType()
Returns the type of the current value.

Returns:
type of values held

newAggregator

Aggregator newAggregator()
Make a new, initalized aggregation state.

Returns:
initialized copy of the aggregator