no.sintef.event
Class Concentrator

java.lang.Object
  extended byno.sintef.event.Concentrator

public class Concentrator
extends java.lang.Object

Event concentrator reduces overhead of many rapid events by collecting multiple events within a time window, firing only a single event once the time window elapses.

Author:
Fredrik Vraalsen

Constructor Summary
Concentrator(int windowLength, java.lang.Runnable eventHandler)
          Concentrator constructor.
 
Method Summary
 void fireEvent()
          If event is already queued, just return, otherwise start new thread and wait for specified time window before firing event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Concentrator

public Concentrator(int windowLength,
                    java.lang.Runnable eventHandler)
Concentrator constructor.

Parameters:
windowLength - length of time window used for collecting events
eventHandler - the event handler to activate once the time window has elapsed
Method Detail

fireEvent

public final void fireEvent()
If event is already queued, just return, otherwise start new thread and wait for specified time window before firing event.



Copyright © 2003-2005 SINTEF. All Rights Reserved.