TMsg - The type of message to send to all the observers.ADispatcher, ParallelDispatcher, SequentialDispatcherpublic interface IDispatcher<TMsg>
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addObserver(IObserver<TMsg> obs) |
Add an observer to the dispatcher.
|
java.util.Set<IObserver<TMsg>> |
getAllObservers() |
Get a COPY of the set of all the observers currently in the dispatcher.
|
java.util.Set<IObserver<TMsg>> |
removeAllObservers() |
Removes all the observers currently in the dispatcher
|
IObserver<TMsg> |
removeObserver(IObserver<TMsg> obs) |
Remove an observer from the dispatcher.
|
void |
updateAll(TMsg msg) |
Send the given message to all the observers in the dispatcher
|
boolean addObserver(IObserver<TMsg> obs)
obs - The IObserver to addjava.lang.ClassCastException - If the observer cannot be properly compared against the existing observersjava.lang.NullPointerException - If the supplied value is nullIObserver<TMsg> removeObserver(IObserver<TMsg> obs)
obs - The IObserver to addjava.util.Set<IObserver<TMsg>> getAllObservers()
java.util.Set<IObserver<TMsg>> removeAllObservers()
void updateAll(TMsg msg)
msg - The IMsg to send to all the observers