Class dnx.util.DNXObservableEngine
All Packages Class Hierarchy This Package Previous Next Index
Class dnx.util.DNXObservableEngine
java.lang.Object
|
+----dnx.util.DNXObject
|
+----dnx.util.DNXInstancedObject
|
+----dnx.util.DNXObservableEngine
- public class DNXObservableEngine
- extends DNXInstancedObject
This class is used in conjunction with the DNXObservable interface.
A mechanism has been added so that observers can specify a mask of the
events they want delivered. This avoids the overhead of delivering some
common events to observers unecessarily.
An observable has the option to generate events that subclass DNXObserverEvent.
These events have an event type -- each type should have only one bit set.
An observer can choose to specify by means of a mask, which events should
be delivered. If an observable generates events that do not subclass
DNXObserverEvent, they are delivered to all observers.
DNXObserverEvent subclasses should
avoid intersecting masks between two event classes if an observable
delivers both classes. However, nothing bad will happen if an intersection
occurs.
-
DNXObservableEngine(DNXObservable)
-
-
addObserver(DNXObserver)
-
-
addObserver(DNXObserver, int)
-
-
countObservers()
-
-
deleteObserver(DNXObserver)
-
-
deleteObservers()
-
-
getObservable()
-
-
getObserverEventMask()
-
-
nosyncUpdateObservers(Object)
- Similar to updateObservers(), but does NOT synchronize during
the call to update().
-
updateObservers(Object)
- Call the update() method of all registered observers, passing
the specified ObserverEvent.
DNXObservableEngine
public DNXObservableEngine(DNXObservable observee)
getObservable
public DNXObservable getObservable()
getObserverEventMask
public int getObserverEventMask()
addObserver
public synchronized void addObserver(DNXObserver o)
addObserver
public synchronized void addObserver(DNXObserver o,
int mask)
countObservers
public synchronized int countObservers()
deleteObserver
public synchronized void deleteObserver(DNXObserver o)
deleteObservers
public synchronized void deleteObservers()
updateObservers
public synchronized void updateObservers(Object arg)
- Call the update() method of all registered observers, passing
the specified ObserverEvent.
nosyncUpdateObservers
public void nosyncUpdateObservers(Object arg)
- Similar to updateObservers(), but does NOT synchronize during
the call to update(). It is still allowable to add or delete
observers during the update() method.
All Packages Class Hierarchy This Package Previous Next Index