|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable
This class should be subclassed by observable object, or "data" in the Model-View paradigm. An Observable object may have any number of Observers. Whenever the Observable instance changes, it notifies all of its observers. Notification is done by calling the update() method on all observers.
Constructor Summary | |
Observable()
|
Method Summary | |
void |
addObserver(Observer o)
Adds an observer to the observer list. |
protected void |
clearChanged()
Clears an observable change. |
int |
countObservers()
Counts the number of observers. |
void |
deleteObserver(Observer o)
Deletes an observer from the observer list. |
void |
deleteObservers()
Deletes observers from the observer list. |
boolean |
hasChanged()
Returns a true boolean if an observable change has occurred. |
void |
notifyObservers()
Notifies all observers if an observable change occurs. |
void |
notifyObservers(Object arg)
Notifies all observers of the specified observable change which occurred. |
protected void |
setChanged()
Sets a flag to note an observable change. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Observable()
Method Detail |
public void addObserver(Observer o)
o
- the observer to be addedpublic void deleteObserver(Observer o)
o
- the observer to be deletedpublic void notifyObservers()
public void notifyObservers(Object arg)
arg
- what is being notifiedpublic void deleteObservers()
protected void setChanged()
protected void clearChanged()
public boolean hasChanged()
public int countObservers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |