public class AggregationStateLinearImpl extends Object implements AggregationStateWithSize, AggregationStateLinear
Modifier and Type | Field and Description |
---|---|
protected 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.
|
void |
applyLeave(EventBean[] eventsPerStream,
ExprEvaluatorContext exprEvaluatorContext)
Remove an event.
|
void |
clear()
Clear all events in the group.
|
Collection<EventBean> |
collectionReadOnly()
Returns all events for the group.
|
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.
|
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.
|
EventBean |
getLastValue()
Returns the newest (last) value entered.
|
Iterator<EventBean> |
iterator()
Returns all events for the group.
|
int |
size()
Must return the number of events currently held, if applicable.
|
public AggregationStateLinearImpl(int streamId)
streamId
- stream idpublic void clear()
AggregationState
clear
in interface AggregationState
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 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 EventBean getFirstNthValue(int index)
AggregationStateLinear
getFirstNthValue
in interface AggregationStateLinear
index
- indexpublic EventBean getLastNthValue(int index)
AggregationStateLinear
getLastNthValue
in interface AggregationStateLinear
index
- indexpublic EventBean getFirstValue()
AggregationStateLinear
getFirstValue
in interface AggregationStateLinear
public EventBean getLastValue()
AggregationStateLinear
getLastValue
in interface AggregationStateLinear
public Iterator<EventBean> iterator()
AggregationStateLinear
iterator
in interface AggregationStateLinear
public Collection<EventBean> collectionReadOnly()
AggregationStateLinear
collectionReadOnly
in interface AggregationStateLinear
public int size()
AggregationStateWithSize
size
in interface AggregationStateLinear
size
in interface AggregationStateWithSize