|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object becker.util.Observers
public class Observers
An instance of Observers
is usually used by a class implementing
IObservable
to store its list of observers. Each time the
class changes, it should call notifyObservers
. This, in turn,
calls the update
method for each of the observers stored in
the list.
IObservable
,
IObserver
Constructor Summary | |
---|---|
Observers()
Construct a new list of observers. |
Method Summary | |
---|---|
void |
addObserver(IObserver observer)
Add another observer to the list. |
void |
notifyObservers(Object theObserved,
Object changeInfo)
Notify each of the observers on the list that something has happened to the object they are observing. |
void |
removeObserver(IObserver observer)
Remove a specific observer from the list. |
void |
removeObservers()
Remove all the observers from the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Observers()
Method Detail |
---|
public void addObserver(IObserver observer)
addObserver
in interface IObservable
observer
- The observer to add.public void removeObserver(IObserver observer)
removeObserver
in interface IObservable
observer
- The observer to remove.public void removeObservers()
removeObservers
in interface IObservable
public void notifyObservers(Object theObserved, Object changeInfo)
theObserved
- The object that changed.changeInfo
- Additional information about what changed. May be
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |