com.rolemodelsoft.drawlet.util
Interface Observable

All Known Implementing Classes:
BasicObservable

public interface Observable

This interface defines a generic Observable interface. This is desirable as the java.util.Observable is a class which could force unnatural hierarchies. It also allows public access to a list of Observers as an array which may not be the actual collection of observers, allowing implementers to let others know what they are observing without allowing them to modify that list through "illegal" channels.


Method Summary
 void addObserver(Observer observer)
          Adds an observer to the observer list.
 void deleteObserver(Observer observer)
          Deletes an observer from the observer list.
 void deleteObservers()
          Deletes all observers from the observer list.
 Observer[] getObservers()
          Answers a collection of observers.
 void notifyObservers()
          Notifies all observers that an observable change occurs.
 void notifyObservers(java.lang.Object arg)
          Notifies all observers that an observable change occurred.
 

Method Detail

addObserver

public void addObserver(Observer observer)
Adds an observer to the observer list.
Parameters:
observer - the observer to be added.

deleteObserver

public void deleteObserver(Observer observer)
Deletes an observer from the observer list.
Parameters:
observer - the observer to be deleted.

deleteObservers

public void deleteObservers()
Deletes all observers from the observer list. Though this is public, caution should be used before anything other than "this" invokes it.

getObservers

public Observer[] getObservers()
Answers a collection of observers.
Returns:
an array of Observers.

notifyObservers

public void notifyObservers()
Notifies all observers that an observable change occurs. Though this is public, caution should be used before anything other than "this" does.

notifyObservers

public void notifyObservers(java.lang.Object arg)
Notifies all observers that an observable change occurred. Though this is public, caution should be used before anything other than "this" invokes it.
Parameters:
arg - info to pass along to those being notified.