net.esper.eql.expression
Class UniqueValueAggregator

java.lang.Object
  extended by net.esper.eql.expression.UniqueValueAggregator
All Implemented Interfaces:
Aggregator

public class UniqueValueAggregator
extends Object
implements Aggregator

Aggregator for use on top of another aggregator that handles unique value aggregation (versus all-value aggregation) for the underlying aggregator.


Constructor Summary
UniqueValueAggregator(Aggregator inner)
          Ctor.
 
Method Summary
 void enter(Object value)
          Apply the value as entering aggregation (entering window).
 Object getValue()
          Returns the current value held.
 Class getValueType()
          Returns the type of the current value.
 void leave(Object value)
          Apply the value as leaving aggregation (leaving window).
 Aggregator newAggregator()
          Make a new, initalized aggregation state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueValueAggregator

public UniqueValueAggregator(Aggregator inner)
Ctor.

Parameters:
inner - is the aggregator function computing aggregation values
Method Detail

enter

public void enter(Object value)
Description copied from interface: Aggregator
Apply the value as entering aggregation (entering window).

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

Specified by:
enter in interface Aggregator
Parameters:
value - to add to aggregate

leave

public void leave(Object value)
Description copied from interface: Aggregator
Apply the value as leaving aggregation (leaving window).

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

Specified by:
leave in interface Aggregator
Parameters:
value - to remove from aggregate

getValue

public Object getValue()
Description copied from interface: Aggregator
Returns the current value held.

Specified by:
getValue in interface Aggregator
Returns:
current value

getValueType

public Class getValueType()
Description copied from interface: Aggregator
Returns the type of the current value.

Specified by:
getValueType in interface Aggregator
Returns:
type of values held

newAggregator

public Aggregator newAggregator()
Description copied from interface: Aggregator
Make a new, initalized aggregation state.

Specified by:
newAggregator in interface Aggregator
Returns:
initialized copy of the aggregator