[/url] [url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview
Class
JavaTM 2 Platform
Std. Ed. v1.4.2
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
java.util
Interface Observerpublic interface ObserverA class can implement the Observer interface when it wants to be informed of changes in observable objects. 如果一个类希望在可观察对象变化时得到通知,它可以实现Observer接口。
Since: JDK1.0 See Also: ObservableMethod Summary
void
update(Observable o, Object arg)
This method is called whenever the observed object is changed. 一旦被观察对象发生变化时调用该方法。
Method Detail
updatepublic void update(Observable o,
Object arg)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change. 一旦被观察对象发生变化时调用该方法。应用程序调用Observable对象的notifyObservers 方法,可以就其自身的变化通知所有对象的观察者们。
Parameters: o - the observable object. 可观察对象。 arg - an argument passed to the notifyObservers method. 传递给notifyObservers方法的参数。[/url][url=file:///F:/资料/文字资料/j2sdk-1_4_2-doc/docs/api/overview-summary.html]Overview
Class
JavaTM 2 Platform
Std. Ed. v1.4.2
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.