net.esper.view.ext
Class IStreamSortedRandomAccess

java.lang.Object
  extended by net.esper.view.ext.IStreamSortedRandomAccess
All Implemented Interfaces:
RandomAccessByIndex

public class IStreamSortedRandomAccess
extends Object
implements RandomAccessByIndex

Provides random access into a sorted-window's data.


Nested Class Summary
static interface IStreamSortedRandomAccess.IStreamRandomAccessUpdateObserver
          For indicating that the collection has been updated.
 
Constructor Summary
IStreamSortedRandomAccess(IStreamSortedRandomAccess.IStreamRandomAccessUpdateObserver updateObserver)
          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 refresh(TreeMap<MultiKeyUntyped,LinkedList<EventBean>> sortedEvents, int currentSize, int maxSize)
          Refreshes the random access data with the updated information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IStreamSortedRandomAccess

public IStreamSortedRandomAccess(IStreamSortedRandomAccess.IStreamRandomAccessUpdateObserver updateObserver)
Ctor.

Parameters:
updateObserver - for indicating updates to
Method Detail

refresh

public void refresh(TreeMap<MultiKeyUntyped,LinkedList<EventBean>> sortedEvents,
                    int currentSize,
                    int maxSize)
Refreshes the random access data with the updated information.

Parameters:
sortedEvents - is the sorted window contents
currentSize - is the current size of the window
maxSize - is the maximum size of the window

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