- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubject.java
More file actions
Latest commit
16 lines (13 loc) · 469 Bytes
/
Copy pathSubject.java
File metadata and controls
16 lines (13 loc) · 469 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
* Objects implementing this interface allow observers
* to register with it. When this object changes state,
* it notifies all registered observers.
*/
publicinterfaceSubject {
/* allows an observer to register with the subject */
publicvoidaddObserver (Observero);
/* removes an observer */
publicvoidremoveObserver (Observero);
/* notify all registered observers when its state changes */
publicvoidnotifyObservers();
}