public class IdeSubject extends java.lang.Object implements Subject
IdeSubject class defines the API to register Observers that are interested in receiving notifications of Subject changes. Classes that can have multiple views in particular must implement the Subject interface so that all observing views can be notified when changes have occurred.Observer, UpdateMessage| Constructor and Description |
|---|
IdeSubject() |
| 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 Subject interface 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
Subject interface changes. |
void |
notifyObservers(java.lang.Object observed, UpdateMessage change)
Notifies all observers that the state of the subject has changed.
|
public final void attach(Observer observer)
Observer interested in being notified when the internal state of the class implementing the Subject interface changes. If the observer is already attached, this method does nothing.public final void detach(Observer observer)
Subject interface changes.
public final void notifyObservers(java.lang.Object observed,
UpdateMessage change)
notifyObservers in interface Subjectsubject - the subject whose state has changed.change - what changed.