net.esper.view.internal
Class PriorEventBufferUnbound

java.lang.Object
  extended by net.esper.view.internal.PriorEventBufferUnbound
All Implemented Interfaces:
ViewUpdatedCollection, RandomAccessByIndex

public class PriorEventBufferUnbound
extends Object
implements ViewUpdatedCollection, RandomAccessByIndex

Buffer class for insert stream events only for use with unbound streams that inserts data only, to serve up one or more prior events in the insert stream based on an index.

Does not expect or care about the remove stream and simple keeps a rolling buffer of new data events up to the maximum prior event we are asking for.


Constructor Summary
PriorEventBufferUnbound(int maxPriorIndex)
          Ctor.
 
Method Summary
 EventBean getNewData(int index)
          Returns an new data event given an index.
 EventBean getOldData(int index)
          Returns an old data event given an index.
 void update(EventBean[] newData, EventBean[] oldData)
          Accepts view insert and remove stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorEventBufferUnbound

public PriorEventBufferUnbound(int maxPriorIndex)
Ctor.

Parameters:
maxPriorIndex - is the highest prior-event index required by any expression
Method Detail

update

public void update(EventBean[] newData,
                   EventBean[] oldData)
Description copied from interface: ViewUpdatedCollection
Accepts view insert and remove stream.

Specified by:
update in interface ViewUpdatedCollection
Parameters:
newData - is the insert stream events or null if no data
oldData - is the remove stream events or null if no data

getNewData

public EventBean getNewData(int index)
Description copied from interface: RandomAccessByIndex
Returns an new data event given an index.

Specified by:
getNewData in interface RandomAccessByIndex
Parameters:
index - to return new data for
Returns:
new data event

getOldData

public EventBean getOldData(int index)
Description copied from interface: RandomAccessByIndex
Returns an old data event given an index.

Specified by:
getOldData in interface RandomAccessByIndex
Parameters:
index - to return old data for
Returns:
old data event