Line | |
---|
1 | package org.apollo.mvc;
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * An Observer as any object that would like to be notified
|
---|
5 | * when another object changes. To do this the object that will change
|
---|
6 | * must implement the Subject interface and then the Observer object
|
---|
7 | * should be registered with the Subject by calling addObserver()
|
---|
8 | *
|
---|
9 | * @author Brook NOvak
|
---|
10 | */
|
---|
11 | public interface Observer {
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * The method called when a Subject that this observer has
|
---|
15 | * registered with changes and the Subject has specified a SubjectChangedEvent.
|
---|
16 | *
|
---|
17 | * @param event A type of SubjectChangedEvent
|
---|
18 | * @param source The subject which the event was fired from
|
---|
19 | */
|
---|
20 | void modelChanged(Subject source, SubjectChangedEvent event);
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Informs this observer what it is observing.
|
---|
24 | * The subject will call this automatically.
|
---|
25 | * The observer must know what it's observing so that
|
---|
26 | * it can update based on the subject's data.
|
---|
27 | *
|
---|
28 | * @param parent the subject we are observing
|
---|
29 | */
|
---|
30 | void setObservedSubject(Subject parent);
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Provides functionality to retrieve the subject that this class
|
---|
34 | * will be observing.
|
---|
35 | *
|
---|
36 | * @return the subject we are observing
|
---|
37 | */
|
---|
38 | Subject getObservedSubject();
|
---|
39 |
|
---|
40 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.