public interface Observer
Observable
objects.ComplexObserver
Modifier and Type | Method and Description |
---|---|
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
void update(Observable observable, Object notification)
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
observable
- the observable object.notification
- the notification data.