-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSubject.java
32 lines (29 loc) · 887 Bytes
/
Subject.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package observerdesignpattern;
/**
* Represents a subject which is observed by Observers
*
* @author Nghia Nguyen
*
*/
public interface Subject {
/**
* Registers the observer that observes a subject, typically to the subject's list of observers
*
* @param observer - who observes a subject
*/
public void registerObserver(Observer observer);
/**
* Removes the observer from a subject's list of observers
*
* @param observer - an observer to remove from the subject's list of observers
*/
public void removeObserver(Observer observer);
/**
* Notifies each observer to the subject of a sighting with location and a description of that
* sighting
*
* @param location - where the subject was seen
* @param description - a description about that sighting
*/
public void notifyObservers(String location, String description);
}