Package ucar.unidata.util
Class AsynchronousPropertyChangeWrapper
java.lang.Object
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 PropertyChangeEvent
s
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
ConstructorsConstructorDescriptionConstructs from nothing. -
Method Summary
Modifier and TypeMethodDescriptionvoid
doRemove()
_more_final void
Receives aPropertyChangeEvent
for asynchronous handling.final void
run()
Executes the asynchronous,PropertyChangeEvent
-handling thread.
-
Constructor Details
-
AsynchronousPropertyChangeWrapper
Constructs from nothing. ThePropertyChangeEvent
thread will be started.- Parameters:
listener
- The listener to be wrapped.- Throws:
NullPointerException
- if the listener isnull
.
-
-
Method Details
-
doRemove
public void doRemove()_more_ -
run
public final void run()Executes the asynchronous,PropertyChangeEvent
-handling thread. -
propertyChange
Receives aPropertyChangeEvent
for asynchronous handling. The event is placed on the event-queue, replacing any previous event.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
event
- The event to receive. May benull
.
-