com.graemestevenson.observer
Interface Observer<T>

Type Parameters:
T - the type of the argument passed to the update method.

public interface Observer<T>

A class can implement the Observer interface when it wants to be informed of changes in observable objects.

This code (and documentation) is based on the Observer class provided with the Java SDK ( java.util.Observer), but extends it to use generics. The generic parameter associated with this class allows the programmer to state the type of the object passed using the update method. This is coupled with the generic Observervable interface which supports a typed notifyAll method.

Author:
Graeme Stevenson (graeme.stevenson@ucd.ie), based on Chris Warth's code and documentation from the Java SDK.

Method Summary
 void update(Observable<T> an_observable, T an_argument)
          This method is called whenever the observed object is changed.
 

Method Detail

update

void update(Observable<T> an_observable,
            T an_argument)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change.

Parameters:
an_observable - the observable object.
an_argument - an argument passed to the notifyObservers method.