Class Filter

java.lang.Object
   |
   +----Filter

public class Filter
extends Object
implements Runnable
This class implements an object thinner. It may be used, for instance, to "thin" mouse motion events. Because mouse motion events usually come in bursts, and the event processing time may be longer, they must be thinned to avoid unpleasant bottleneck. An event is placed into a buffer of unit size, and is dispatched to the event receiver. A delay timer is started. Each incoming event will overwrite its undispatched predecessor, if any. Events are dispatched from the buffer at a rate defined by the delay (msec). This mechanism guarantees that the very first and the very last events in a burst will be dispatched; other events will be dispatched every delay interval. In case of mouse motion events, losing some of them does not present a problem, since they contain entire mouse state.

See Also:
ObjectReceiver

Variable Index

 o delay
delay interval, msec
 o object
object (event) buffer of unit size
 o thread
dispatching thread

Constructor Index

 o Filter(ObjectReceiver, long)
Constructs an object burst filter.

Method Index

 o put(Object)
 o run()
Dispatches objects to the receiver.
 o setDelay(long)
Sets delay interval.

Variables

 o object
 Object object
object (event) buffer of unit size

 o delay
 long delay
delay interval, msec

 o thread
 Thread thread
dispatching thread

Constructors

 o Filter
 public Filter(ObjectReceiver receiver,
               long delay)
Constructs an object burst filter.

Parameters:
receiver - object receiver to be notified.
delay - dispatching delay interval in msec.

Methods

 o setDelay
 public void setDelay(long delay)
Sets delay interval.

Parameters:
delay - dispatching delay interval in msec.
 o run
 public void run()
Dispatches objects to the receiver.

 o put
 public synchronized void put(Object object)