com.espertech.esper.epl.agg.access
Class AggregationAccessorFirstLastIndexWEval

java.lang.Object
  extended by com.espertech.esper.epl.agg.access.AggregationAccessorFirstLastIndexWEval
All Implemented Interfaces:
AggregationAccessor

public class AggregationAccessorFirstLastIndexWEval
extends java.lang.Object
implements AggregationAccessor

Represents the aggregation accessor that provides the result for the "first" and "last" aggregation function with index.


Constructor Summary
AggregationAccessorFirstLastIndexWEval(int streamNum, ExprEvaluator childNode, ExprEvaluator indexNode, int constant, boolean isFirst)
          Ctor.
 
Method Summary
 EventBean getEnumerableEvent(AggregationState state, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Return the aggregation state value consisting of a single event.
 java.util.Collection<EventBean> getEnumerableEvents(AggregationState state, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Return the aggregation state value consisting of a collection of events.
 java.util.Collection<java.lang.Object> getEnumerableScalar(AggregationState state, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Return the aggregation state value consisting of a collection of scalar values.
 java.lang.Object getValue(AggregationState state, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Return the aggregation state value either as a scalar value or any other object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregationAccessorFirstLastIndexWEval

public AggregationAccessorFirstLastIndexWEval(int streamNum,
                                              ExprEvaluator childNode,
                                              ExprEvaluator indexNode,
                                              int constant,
                                              boolean isFirst)
Ctor.

Parameters:
streamNum - stream id
childNode - expression
indexNode - index expression
constant - constant index
isFirst - true if returning first, false for returning last
Method Detail

getValue

public java.lang.Object getValue(AggregationState state,
                                 EventBean[] eventsPerStream,
                                 boolean isNewData,
                                 ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationAccessor
Return the aggregation state value either as a scalar value or any other object.

For enumeration over scalar values or objects return an array or collection of scalar or object values.

Use the #getEnumerableEvents method to return a collection of events.

Use the #getEnumerableEvent to return a single events.

Specified by:
getValue in interface AggregationAccessor
Parameters:
state - aggregation state, downcast as needed
eventsPerStream - events
isNewData - new-data indicator
exprEvaluatorContext - eval context
Returns:
return value

getEnumerableEvents

public java.util.Collection<EventBean> getEnumerableEvents(AggregationState state,
                                                           EventBean[] eventsPerStream,
                                                           boolean isNewData,
                                                           ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationAccessor
Return the aggregation state value consisting of a collection of events.

Specified by:
getEnumerableEvents in interface AggregationAccessor
Parameters:
state - aggregation state, downcast as needed
eventsPerStream - events
isNewData - new-data indicator
exprEvaluatorContext - eval context
Returns:
return collection of events or null or empty collection

getEnumerableScalar

public java.util.Collection<java.lang.Object> getEnumerableScalar(AggregationState state,
                                                                  EventBean[] eventsPerStream,
                                                                  boolean isNewData,
                                                                  ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationAccessor
Return the aggregation state value consisting of a collection of scalar values.

Specified by:
getEnumerableScalar in interface AggregationAccessor
Parameters:
state - aggregation state, downcast as needed
eventsPerStream - events
isNewData - new-data indicator
exprEvaluatorContext - eval context
Returns:
return collection of scalar or null or empty collection

getEnumerableEvent

public EventBean getEnumerableEvent(AggregationState state,
                                    EventBean[] eventsPerStream,
                                    boolean isNewData,
                                    ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: AggregationAccessor
Return the aggregation state value consisting of a single event.

Specified by:
getEnumerableEvent in interface AggregationAccessor
Parameters:
state - aggregation state, downcast as needed
eventsPerStream - events
isNewData - new-data indicator
exprEvaluatorContext - eval context
Returns:
return event or null

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com