|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.collection.RollingEventBuffer
public class RollingEventBuffer
Event buffer of a given size provides a random access API into the most current event to prior events up to the given size. Oldest events roll out of the buffer first.
Backed by a fixed-size array that is filled forward, then rolls back to the beginning keeping track of the current position.
Constructor Summary | |
---|---|
RollingEventBuffer(int size)
Ctor. |
Method Summary | |
---|---|
void |
add(EventBean theEvent)
Add an event to the buffer. |
void |
add(EventBean[] events)
Add events to the buffer. |
EventBean |
get(int index)
Get an event prior to the last event posted given a number of events before the last. |
EventBean[] |
getBuffer()
|
int |
getNextFreeIndex()
|
int |
getSize()
|
void |
setBuffer(EventBean[] buffer)
|
void |
setNextFreeIndex(int nextFreeIndex)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RollingEventBuffer(int size)
size
- is the maximum number of events in bufferMethod Detail |
---|
public void add(EventBean[] events)
events
- to addpublic void add(EventBean theEvent)
theEvent
- to addpublic EventBean get(int index)
Thus index 0 returns the last event added, index 1 returns the prior to the last event added up to the maximum buffer size.
index
- prior event index from zero to max size
public int getSize()
public EventBean[] getBuffer()
public int getNextFreeIndex()
public void setBuffer(EventBean[] buffer)
public void setNextFreeIndex(int nextFreeIndex)
|
© 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 |