edu.uci.isr.yancees.plugin
Class OrderedEventBuffer

java.lang.Object
  extended byedu.uci.isr.yancees.plugin.OrderedEventBuffer

public class OrderedEventBuffer
extends java.lang.Object

Author:
Roberto Silveira Silva Filho [rsilvafi@ics.uci.edu] To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Nested Class Summary
 class OrderedEventBuffer.BufferRecord
          This is a record used to store the event and its source plug-in reference
 
Constructor Summary
OrderedEventBuffer()
           
 
Method Summary
 void addPluginNotification(GenericEvent evt, PluginInterface source)
           
 OrderedEventBuffer.BufferRecord[] getAndEmptyCurrentBuffer()
           
 OrderedEventBuffer.BufferRecord[] getAndEmptyEventsOlderThan(long time)
          Events need to stay in the buffer for some time, waiting for late events to come, which may come out of order.
 int getCurrentSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderedEventBuffer

public OrderedEventBuffer()
Method Detail

addPluginNotification

public void addPluginNotification(GenericEvent evt,
                                  PluginInterface source)

getAndEmptyCurrentBuffer

public OrderedEventBuffer.BufferRecord[] getAndEmptyCurrentBuffer()
Returns:
ALL the events in the buffer and empty it

getAndEmptyEventsOlderThan

public OrderedEventBuffer.BufferRecord[] getAndEmptyEventsOlderThan(long time)
Events need to stay in the buffer for some time, waiting for late events to come, which may come out of order. This method collects the events that are older than the specified time in milliseconds.

Returns:
the evnets that are in the buffer for more than time ms

getCurrentSize

public int getCurrentSize()
Returns:
the current buffer size