|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wotonomy.control.EODelayedObserverQueue
public class EODelayedObserverQueue
EODelayedObserverQueue allows EODelayedObservers
to receive only one subjectChanged() message
after numerous willChange() messages have
been sent. Observers are then notified in order
of their priority property,
so that certain observers can be notified before
others for whatever application-specific purpose.
This class is not thread-safe and should be used
only for single-threaded GUI clients (AWT and Swing).
Important note: because AWT's event queue does
not allow for priority-based scheduling, this
class installs a custom event queue, replacing
the existing queue on the AWT dispatch thread.
We know of no way around this problem.
Implementation note: this queue relies on the
result of equals() for maintaining a set of
objects on the queue. If two EODelayedObservers
evaluate to the same value using equals(), only
one of them will exist on the queue. If this,
starts to suck, we can change it.
Field Summary | |
---|---|
static int |
FlushDelayedObserversRunLoopOrdering
The default run loop ordering flushes the delayed observers up to ObserverPrioritySixth before dispatching the AWT event queue. |
Constructor Summary | |
---|---|
EODelayedObserverQueue()
Default constructor. |
Method Summary | |
---|---|
static EODelayedObserverQueue |
defaultObserverQueue()
Returns the system default observer queue. |
void |
dequeueObserver(EODelayedObserver anObserver)
Removes the specified observer from the queue. |
void |
enqueueObserver(EODelayedObserver anObserver)
Adds the specified observer to the queue. |
void |
flushObserverQueue(java.lang.Object anObject)
This method is called by the event queue run loop and calls notifyObserversUpToPriority with ObserverPriorityLater. |
void |
notifyObserversUpToPriority(int priority)
Notifies all observers with priority equal to or greater than the specified priority. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int FlushDelayedObserversRunLoopOrdering
Constructor Detail |
---|
public EODelayedObserverQueue()
Method Detail |
---|
public static EODelayedObserverQueue defaultObserverQueue()
public void dequeueObserver(EODelayedObserver anObserver)
public void enqueueObserver(EODelayedObserver anObserver)
public void notifyObserversUpToPriority(int priority)
public void flushObserverQueue(java.lang.Object anObject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |