public interface Subject
Subject interface defines the API to register observers
 interested in receiving notifications of subject changes.
 Classes that can be viewed by multiple views should implement the
 Subject interface in order to notify their observers
 that changes have ocurred.Observer, 
UpdateMessage| Modifier and Type | Method and Description | 
|---|---|
| void | attach(Observer observer)Registers an observer interested in being notified when the internal
 state of the class implementing the  Subjectinterface
 changes. | 
| void | detach(Observer observer)Unregisters an observer that is not interested anymore in being notified
 when the internal state of the class implementing the  Subjectinterface changes. | 
| void | notifyObservers(java.lang.Object subject,
               UpdateMessage change)Notifies all observers that the state of the subject has changed. | 
void attach(Observer observer)
Subject interface
 changes.
 Implementors should do nothing when the same observer is added more
 than once.observer - the Observer interested in change notification
                 messages.void detach(Observer observer)
Subject
 interface changes.
 Implementors should do nothing when the same observer is removed more
 than once.observer - the Observer disinterested in change
                 notification messages.void notifyObservers(java.lang.Object subject,
                     UpdateMessage change)
subject - the subject whose state has changed.change - what changed.