org.jscience.util
Interface ChangeHub


public interface ChangeHub

Interface implemented by ChangeHubs, i.e. classes that handle behaviour for multiple instances of Changeable classes.

Listeners are indexed with a key and when an event is fired, only listeners with the same key are invoked. The class manages the mapping between key and listener. It is the users responsibility to compute the key.

Since:
1.3

Method Summary
 void addListener(java.lang.Object key, ChangeListener listener, ChangeType ct)
          add a ChangeListener associated with given key.
 void firePostChange(java.lang.Object key, ChangeEvent cev)
          invoke the firePostChangeEvent on all ChangeListeners associated with a specific key.
 void firePreChange(java.lang.Object key, ChangeEvent cev)
          invoke the firePreChangeEvent on all ChangeListeners associated with a specific key.
 void removeListener(java.lang.Object key, ChangeListener listener, ChangeType ct)
          remove a ChangeListener associated with given key.
 

Method Detail

addListener

void addListener(java.lang.Object key,
                 ChangeListener listener,
                 ChangeType ct)
add a ChangeListener associated with given key.

Parameters:
key - DOCUMENT ME!
listener - DOCUMENT ME!
ct - DOCUMENT ME!

removeListener

void removeListener(java.lang.Object key,
                    ChangeListener listener,
                    ChangeType ct)
remove a ChangeListener associated with given key.

Parameters:
key - DOCUMENT ME!
listener - DOCUMENT ME!
ct - DOCUMENT ME!

firePreChange

void firePreChange(java.lang.Object key,
                   ChangeEvent cev)
                   throws ChangeVetoException
invoke the firePreChangeEvent on all ChangeListeners associated with a specific key.

Parameters:
key - DOCUMENT ME!
cev - DOCUMENT ME!
Throws:
ChangeVetoException - DOCUMENT ME!

firePostChange

void firePostChange(java.lang.Object key,
                    ChangeEvent cev)
invoke the firePostChangeEvent on all ChangeListeners associated with a specific key.

Parameters:
key - DOCUMENT ME!
cev - DOCUMENT ME!