Mp3dings 
20100427

de.mospace.swing.event
Class Aggregator

java.lang.Object
  extended by de.mospace.swing.event.Aggregator

public class Aggregator
extends Object

When the same runnable is invoked several times through an Aggregator's aggregatedInvokeLater method during a predefined delay it is executed only once. This facility can be used for example to reduce the frequency of costly GUI updates after changes to the displayed data.

Version:
$Revision: 12 $ ($Date: 2007-07-27 11:48:53 +0200 (Fr, 27 Jul 2007) $)
Author:
Moritz Ringler

Constructor Summary
Aggregator(long aggregationTime, boolean reset)
          Constructs a new aggregator with the specified delay and reset behavior.
 
Method Summary
 void aggregatedInvokeLater(Runnable r)
          Schedules the specified runnable for execution after the aggregation delay.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aggregator

public Aggregator(long aggregationTime,
                  boolean reset)
Constructs a new aggregator with the specified delay and reset behavior.

Parameters:
aggregationTime - the period of time the aggregator waits for further calls to aggregatedInvokeLater(java.lang.Runnable) before an invoked runnable is executed.
reset - wether to reset the timer waiting for further calls to aggregatedInvokeLater when aggregatedInvokeLater is invoked a second time with the same argument during the aggregation period
Method Detail

aggregatedInvokeLater

public void aggregatedInvokeLater(Runnable r)
Schedules the specified runnable for execution after the aggregation delay. When the same runnable is invoked another time during the aggregation delay it is executed only once.

Parameters:
r - the runnable to schedule

Mp3dings 
20100427