Revision 695 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/observer/Observer.java
Observer.java | ||
---|---|---|
19 | 19 |
* MA 02110-1301, USA. |
20 | 20 |
* |
21 | 21 |
*/ |
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 IVER T.I. S.A. {{Task}} |
|
26 |
*/ |
|
27 | 22 |
package org.gvsig.tools.observer; |
28 | 23 |
|
24 |
import org.gvsig.tools.observer.impl.DefaultComplexNotification; |
|
29 | 25 |
|
26 |
/** |
|
27 |
* A interface to be implemented by objects that want to be |
|
28 |
* informed of changes in {@link Observable} objects. |
|
29 |
* |
|
30 |
* @see ComplexObserver |
|
31 |
* |
|
32 |
* @author gvSIG Team |
|
33 |
* @version $Id$ |
|
34 |
*/ |
|
30 | 35 |
public interface Observer { |
31 | 36 |
|
37 |
/** |
|
38 |
* Called whenever a {@link Observable} object is changed and this |
|
39 |
* {@link Observer} has registered on it to receive notifications. |
|
40 |
* <p> |
|
41 |
* Implementations of this method will be called for each simple |
|
42 |
* notification or, if a complex notification is created, for each of the |
|
43 |
* child notifications. |
|
44 |
* </p> |
|
45 |
* <p> |
|
46 |
* In the latter case, don't assume any ordering in the notification between |
|
47 |
* this {@link Observer} and other {@link Observer}s listening to the same |
|
48 |
* {@link Observable}. |
|
49 |
* </p> |
|
50 |
* <p> |
|
51 |
* In a complex notification scenario, if you want to receive only the |
|
52 |
* complex notification and not each of the child notifications, just |
|
53 |
* implement the {@link ComplexObserver} and prepare this method |
|
54 |
* implementation to handle receiving {@link DefaultComplexNotification} instances |
|
55 |
* as well as direct notification objects. |
|
56 |
* </p> |
|
57 |
* |
|
58 |
* @param observable |
|
59 |
* the observable object. |
|
60 |
* @param notification |
|
61 |
* the notification data. |
|
62 |
*/ |
|
32 | 63 |
public void update(Observable observable, Object notification); |
33 | 64 |
|
34 | 65 |
} |
Also available in: Unified diff