|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.epl.agg.aggregator.AggregatorNth
public class AggregatorNth
Aggregator to return the Nth oldest element to enter, with N=1 the most recent value is returned. If N is larger than the enter minus leave size, null is returned. A maximum N historical values are stored, so it can be safely used to compare recent values in large views without incurring excessive overhead.
Field Summary | |
---|---|
protected java.lang.Object[] |
circularBuffer
|
protected int |
currentBufferElementPointer
|
protected long |
numDataPoints
|
protected java.lang.Class |
returnType
|
protected int |
sizeBuf
|
Constructor Summary | |
---|---|
AggregatorNth(java.lang.Class returnType,
int sizeBuf)
Ctor. |
Method Summary | |
---|---|
void |
clear()
Clear out the collection. |
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.Class returnType
protected final int sizeBuf
protected java.lang.Object[] circularBuffer
protected int currentBufferElementPointer
protected long numDataPoints
Constructor Detail |
---|
public AggregatorNth(java.lang.Class returnType, int sizeBuf)
returnType
- return typesizeBuf
- sizeMethod Detail |
---|
public void enter(java.lang.Object value)
AggregationMethod
The value can be null since 'null' values may be counted as unique separate values.
enter
in interface AggregationMethod
value
- to add to aggregatepublic void leave(java.lang.Object value)
AggregationMethod
The value can be null since 'null' values may be counted as unique separate values.
leave
in interface AggregationMethod
value
- to remove from aggregatepublic java.lang.Class getValueType()
AggregationMethod
getValueType
in interface AggregationMethod
public java.lang.Object getValue()
AggregationMethod
getValue
in interface AggregationMethod
public void clear()
AggregationMethod
clear
in interface AggregationMethod
|
© 2006-2015 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |