choco
Interface IObservable

All Known Subinterfaces:
IObservableStepSearchLoop
All Known Implementing Classes:
ObservableStepSearchLoop, ObservableVarEventQueue

public interface IObservable


Method Summary
 void addObserver(IObserver o)
          Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.
 void notifyObservers(Object arg)
          If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.
 

Method Detail

addObserver

void addObserver(IObserver o)
Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set. The order in which notifications will be delivered to multiple observers is not specified. See the class comment.

Parameters:
o - an observer to be added.
Throws:
NullPointerException - if the parameter o is null.

notifyObservers

void notifyObservers(Object arg)
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.

Each observer has its update method called with two arguments: this observable object and the arg argument.

Parameters:
arg - any object.
See Also:
IObserver.update(IObservable, java.lang.Object)


Copyright © 2012. All Rights Reserved.