[all packages]
[package java.util]
[class hierarchy]
[index]
java.lang.Object | +----java.util.Observable
public class Observable
An observable object can have one or more observers. An observer
may be any object that implements interface Observer. After an
observable instance changes, an application calling the
Observable's notifyObservers method
causes all of its observers to be notified of the change by a call
to their update method.
The order in which notifications will be delivered is unspecified. The default implementation provided in the Observerable class will notify Observers in the order in which they registered interest, but subclasses may change this order, use no guaranteed order, deliver notifications on separate threaads, or may guarantee that their subclass follows this order, as they choose.
Note that this notification mechanism is has nothing to do with threads and is completely separate from the wait and notify mechanism of class Object.
When an observable object is newly created, its set of observers is empty. Two observers are considered the same if and only if the equals method returns true for them.

Observable()

addObserver(Observer)
clearChanged()
countObservers()
deleteObserver(Observer)
deleteObservers()
hasChanged()
notifyObservers(Object)
hasChanged method, then
notifyObservers()
hasChanged method, then
setChanged()

Observablepublic Observable();

addObserverpublic synchronized void addObserver(Observer o);
public synchronized void deleteObserver(Observer o);
public void notifyObservers();
hasChanged method, then notify all of its observers
and then call the clearChanged method to
indicate that this object has no longer changed.
Each observer has its update method called with two
arguments: this observable object and null. In other
words, this method is equivalent to:
notifyOvservers(null)
public void notifyObservers(Object arg);
hasChanged method, then notify all of its observers
and then call the clearChanged method to indicate
that this object has no longer changed.
Each observer has its update method called with two
arguments: this observable object and the arg argument.
public synchronized void deleteObservers();
protected synchronized void setChanged();
protected synchronized void clearChanged();
notifyObservers methods.
public synchronized boolean hasChanged();
true if and only if the setChanged
method has been called more recently than the
clearChanged method on this object;
false otherwise.public synchronized int countObservers();
[all packages]
[package java.util]
[class hierarchy]
[index]