java.lang.Object | +--java.util.Observable
Untamed:
Observable()
void
addObserver(Observer o)
protected void
clearChanged()
void
deleteObserver(Observer o)
void
deleteObservers()
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.
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.
protected void
setChanged()
private boolean changed
private Vector obs
public Observable()
public void addObserver(Observer o)
o - an observer to be added.
NullPointerException - if the parameter o is null.public void deleteObserver(Observer o)
o - the observer to be deleted.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:
notifyObservers(null)
java.util.Observable#clearChanged(),
java.util.Observable#hasChanged(),
java.util.Observer#update(java.util.Observable, java.lang.Object)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.
arg - any object.java.util.Observable#clearChanged(),
java.util.Observable#hasChanged(),
java.util.Observer#update(java.util.Observable, java.lang.Object)public void deleteObservers()
protected void setChanged()
protected void clearChanged()
notifyObservers methods.
java.util.Observable#notifyObservers(),
java.util.Observable#notifyObservers(java.lang.Object)public boolean hasChanged()
true if and only if the setChanged
method has been called more recently than the
clearChanged method on this object;
false otherwise.java.util.Observable#clearChanged(),
java.util.Observable#setChanged()public int countObservers()