public class AggregationStateLinearImpl extends java.lang.Object implements AggregationStateWithSize, AggregationStateLinear
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<EventBean> |
events |
protected int |
streamId |
Constructor and Description |
---|
AggregationStateLinearImpl(int streamId)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
applyEnter(EventBean[] eventsPerStream,
ExprEvaluatorContext exprEvaluatorContext)
Enter an event.
|
static void |
applyEnterCodegen(AggregationStateLinearForge forge,
int stateNumber,
CodegenMethodNode method,
ExprForgeCodegenSymbol symbols,
CodegenClassScope classScope) |
void |
applyLeave(EventBean[] eventsPerStream,
ExprEvaluatorContext exprEvaluatorContext)
Remove an event.
|
static void |
applyLeaveCodegen(AggregationStateLinearForge forge,
int stateNumber,
CodegenMethodNode method,
ExprForgeCodegenSymbol symbols,
CodegenClassScope classScope) |
void |
clear()
Clear all events in the group.
|
static void |
clearCodegen(int stateNumber,
CodegenMethodNode method) |
static CodegenExpression |
codegenGetFirstValue(int column,
CodegenClassScope classScope,
CodegenMethodNode parentMethod) |
static CodegenExpression |
codegenGetLastValue(int column,
CodegenClassScope classScope,
CodegenMethodNode parentMethod) |
static CodegenExpression |
codegenIterator(int slot) |
static CodegenExpression |
codegenSize(int slot) |
java.util.Collection<EventBean> |
collectionReadOnly()
Returns all events for the group.
|
static CodegenExpression |
collectionReadOnlyCodegen(int column) |
java.util.ArrayList<EventBean> |
getEvents() |
EventBean |
getFirstNthValue(int index)
Counting from the first element to the last, returns the oldest (first) value entered for index zero
and the n-th oldest value for index N.
|
static CodegenExpression |
getFirstNthValueCodegen(CodegenExpressionRef index,
int column,
CodegenClassScope classScope,
CodegenMethodNode parentMethod) |
EventBean |
getFirstValue()
Returns the first (oldest) value entered.
|
EventBean |
getLastNthValue(int index)
Counting from the last element to the first, returns the newest (last) value entered for index zero
and the n-th newest value for index N.
|
static CodegenExpression |
getLastNthValueCodegen(CodegenExpressionRef index,
int column,
CodegenClassScope classScope,
CodegenMethodNode parentMethod) |
EventBean |
getLastValue()
Returns the newest (last) value entered.
|
java.util.Iterator<EventBean> |
iterator()
Returns all events for the group.
|
static void |
rowMemberCodegen(int stateNumber,
CodegenCtor ctor,
CodegenMembersColumnized membersColumnized) |
int |
size()
Must return the number of events currently held, if applicable.
|
protected int streamId
protected java.util.ArrayList<EventBean> events
public AggregationStateLinearImpl(int streamId)
streamId
- stream idpublic static void rowMemberCodegen(int stateNumber, CodegenCtor ctor, CodegenMembersColumnized membersColumnized)
public void applyEnter(EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext)
AggregationState
applyEnter
in interface AggregationState
eventsPerStream
- all events in all streams, typically implementations pick the relevant stream's events to addexprEvaluatorContext
- expression eval contextpublic static void applyEnterCodegen(AggregationStateLinearForge forge, int stateNumber, CodegenMethodNode method, ExprForgeCodegenSymbol symbols, CodegenClassScope classScope)
public void applyLeave(EventBean[] eventsPerStream, ExprEvaluatorContext exprEvaluatorContext)
AggregationState
applyLeave
in interface AggregationState
eventsPerStream
- all events in all streams, typically implementations pick the relevant stream's events to removeexprEvaluatorContext
- expression eval contextpublic static void applyLeaveCodegen(AggregationStateLinearForge forge, int stateNumber, CodegenMethodNode method, ExprForgeCodegenSymbol symbols, CodegenClassScope classScope)
public void clear()
AggregationState
clear
in interface AggregationState
public static void clearCodegen(int stateNumber, CodegenMethodNode method)
public EventBean getFirstNthValue(int index)
AggregationStateLinear
getFirstNthValue
in interface AggregationStateLinear
index
- indexpublic static CodegenExpression getFirstNthValueCodegen(CodegenExpressionRef index, int column, CodegenClassScope classScope, CodegenMethodNode parentMethod)
public EventBean getLastNthValue(int index)
AggregationStateLinear
getLastNthValue
in interface AggregationStateLinear
index
- indexpublic static CodegenExpression getLastNthValueCodegen(CodegenExpressionRef index, int column, CodegenClassScope classScope, CodegenMethodNode parentMethod)
public EventBean getFirstValue()
AggregationStateLinear
getFirstValue
in interface AggregationStateLinear
public static CodegenExpression codegenGetFirstValue(int column, CodegenClassScope classScope, CodegenMethodNode parentMethod)
public EventBean getLastValue()
AggregationStateLinear
getLastValue
in interface AggregationStateLinear
public static CodegenExpression codegenGetLastValue(int column, CodegenClassScope classScope, CodegenMethodNode parentMethod)
public java.util.Iterator<EventBean> iterator()
AggregationStateLinear
iterator
in interface AggregationStateLinear
public static CodegenExpression codegenIterator(int slot)
public java.util.Collection<EventBean> collectionReadOnly()
AggregationStateLinear
collectionReadOnly
in interface AggregationStateLinear
public static CodegenExpression collectionReadOnlyCodegen(int column)
public int size()
AggregationStateWithSize
size
in interface AggregationStateLinear
size
in interface AggregationStateWithSize
public static CodegenExpression codegenSize(int slot)
public java.util.ArrayList<EventBean> getEvents()