com.espertech.esper.view.window
Class IStreamRandomAccess

java.lang.Object
  extended by com.espertech.esper.view.window.IStreamRandomAccess
All Implemented Interfaces:
ViewUpdatedCollection, RandomAccessByIndex

public class IStreamRandomAccess
extends java.lang.Object
implements RandomAccessByIndex, ViewUpdatedCollection

For use with length and time window views that must provide random access into data window contents provided for the "previous" expression if used.


Constructor Summary
IStreamRandomAccess(RandomAccessByIndexObserver updateObserver)
          Ctor.
 
Method Summary
 void destroy()
          De-allocate resources held by the collection.
 EventBean getNewData(int index)
          Returns an new data event given an index.
 EventBean getNewDataTail(int index)
           
 int getNumEventsInsertBuf()
           
 EventBean getOldData(int index)
          Returns an old data event given an index.
 java.util.Collection<EventBean> getWindowCollectionReadOnly()
           
 int getWindowCount()
           
 java.util.Iterator<EventBean> getWindowIterator()
           
 boolean isEmpty()
          Returns true for empty.
 void remove(EventBean oldData)
          Remove event.
 void update(EventBean newData)
          Apply event
 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

IStreamRandomAccess

public IStreamRandomAccess(RandomAccessByIndexObserver updateObserver)
Ctor.

Parameters:
updateObserver - is invoked when updates are received
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

remove

public void remove(EventBean oldData)
Remove event.

Parameters:
oldData - event to remove

update

public void update(EventBean newData)
Apply event

Parameters:
newData - to apply

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

destroy

public void destroy()
Description copied from interface: ViewUpdatedCollection
De-allocate resources held by the collection.

Specified by:
destroy in interface ViewUpdatedCollection

isEmpty

public boolean isEmpty()
Returns true for empty.

Returns:
indicator

getNewDataTail

public EventBean getNewDataTail(int index)
Specified by:
getNewDataTail in interface RandomAccessByIndex

getWindowIterator

public java.util.Iterator<EventBean> getWindowIterator()
Specified by:
getWindowIterator in interface RandomAccessByIndex

getWindowCollectionReadOnly

public java.util.Collection<EventBean> getWindowCollectionReadOnly()
Specified by:
getWindowCollectionReadOnly in interface RandomAccessByIndex

getWindowCount

public int getWindowCount()
Specified by:
getWindowCount in interface RandomAccessByIndex

getNumEventsInsertBuf

public int getNumEventsInsertBuf()
Specified by:
getNumEventsInsertBuf in interface ViewUpdatedCollection

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