ucar.unidata.util
Class AsynchronousPropertyChangeWrapper

java.lang.Object
  extended by ucar.unidata.util.AsynchronousPropertyChangeWrapper
All Implemented Interfaces:
PropertyChangeListener, Runnable, EventListener

public final class AsynchronousPropertyChangeWrapper
extends Object
implements Runnable, PropertyChangeListener

Provides support for the asynchronous handling of property-change events. Property-change events are placed in a one-element event-queue for later, asynchronous processing by a wrapped PropertyChangeListener. If more than one event is received while the asynchronous, wrapped PropertyChangeListener is processing an event, then all events but the last are discarded. This implementation is good for PropertyChangeEvents that are self-contained and completely independent of one another.

Version:
$Revision: 1.7 $ $Date: 2006/05/05 19:19:32 $
Author:
Steven R. Emmerson

Constructor Summary
AsynchronousPropertyChangeWrapper(PropertyChangeListener listener)
          Constructs from nothing.
 
Method Summary
 void doRemove()
          _more_
 void propertyChange(PropertyChangeEvent event)
          Receives a PropertyChangeEvent for asynchronous handling.
 void run()
          Executes the asynchronous, PropertyChangeEvent-handling thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousPropertyChangeWrapper

public AsynchronousPropertyChangeWrapper(PropertyChangeListener listener)
Constructs from nothing. The PropertyChangeEvent thread will be started.

Parameters:
listener - The listener to be wrapped.
Throws:
NullPointerException - if the listener is null.
Method Detail

doRemove

public void doRemove()
_more_


run

public final void run()
Executes the asynchronous, PropertyChangeEvent-handling thread.

Specified by:
run in interface Runnable

propertyChange

public final void propertyChange(PropertyChangeEvent event)
Receives a PropertyChangeEvent for asynchronous handling. The event is placed on the event-queue, replacing any previous event.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
event - The event to receive. May be null.