java.util

Interface Observer

public interface Observer

A class can implement the Observer interface when it wants to be informed of changes in observable objects.
Since:
JDK1.0
See Also:
Observable

Method Summary

void
update(Observable o, Object arg)
This method is called whenever the observed object is changed.

Method Details

update

public void update(Observable o,
                   Object arg)
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:
o - the observable object.
arg - an argument passed to the notifyObservers method.
Usages and Demos :

View More Examples of update(Observable o,Object arg)
   1: {
   2:     private final List<Observer> m_listeners = new CopyOnWriteArrayList<Observer>();
   3:     
   4:         ...
   5:     
   6:     public void addObserver(Observer observer)
   7:     {
   8:         ...
   9:         {
  10:             observer.update(null, null);
  11:         }

View Full Code Here
   1:         newNode.addOutgoingEdge(this);
   2:         Observer o = ((Net) getGraph()).getObserver();
   3:         if (o != null) {
   4:         ...
   5:             ChangeSourceAction p = new ChangeSourceAction(initiator, newNode);
   6:             o.update(this, p);
   7:         }
   8:         setSource(newNode);
   9:     }

View Full Code Here
   1:         newNode.addOutgoingEdge(this);
   2:         Observer o = ((Net) getGraph()).getObserver();
   3:         if (o != null) {
   4:         ...
   5:             ChangeSourceAction p = new ChangeSourceAction(initiator, newNode);
   6:             o.update(this, p);
   7:         }
   8:         setSource(newNode);
   9:     }

View Full Code Here
   1: import java.util.Hashtable;
   2: import java.util.Observer;
   3: 
   4:         ...
   5:     newNode.addOutgoingEdge(this);
   6:     Observer o = ((Net) getGraph()).getObserver();
   7:     if (o!=null) {
   8:         ...
   9:       ChangeSourceAction p = new ChangeSourceAction(initiator, newNode);
  10:       o.update(this,p);
  11:     }
  12:         ...
  13:     newNode.addIncomingEdge(this);
  14:     Observer o = ((Net) getGraph()).getObserver();

View Full Code Here
   1:     newNode.addOutgoingEdge(this);
   2:     Observer o = ((Net) getGraph()).getObserver();
   3:     if (o!=null) {
   4:         ...
   5:       ChangeSourceAction p = new ChangeSourceAction(initiator, newNode);
   6:       o.update(this,p);
   7:     }
   8:     setSource(newNode);
   9:   }        

View Full Code Here