becker.util
Interface IObservable

All Known Implementing Classes:
JottoModel, Observers

public interface IObservable

Classes that are observed by others, as in the classic Model-View pattern, should implement the IObservable interface. The interface enforces a standard protocol for adding and removing observers.

The intent of IObservable is similar to java.util.Observable, however, to use Observable it must be extended. If different superclass is required, this is impossible.

Author:
Byron Weber Becker
See Also:
IObserver, Observers

Method Summary
 void addObserver(IObserver observer)
          Add an observer to a list of observers.
 void removeObserver(IObserver observer)
          Remove a specific observer from the list of observers.
 void removeObservers()
          Remove all the observers from the list of observers.
 

Method Detail

addObserver

void addObserver(IObserver observer)
Add an observer to a list of observers. Observers are notified each time an event occurs that changes the state of the observable.

Parameters:
observer - The observer to add.

removeObserver

void removeObserver(IObserver observer)
Remove a specific observer from the list of observers.

Parameters:
observer - The observer to remove.

removeObservers

void removeObservers()
Remove all the observers from the list of observers.