Package org.biojava.utils
Interface ChangeHub
- All Known Implementing Classes:
IndexedChangeHub
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
- Author:
- Thomas Down (original implementation), David Huen (refactoring)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(Object key, ChangeListener listener, ChangeType ct) add a ChangeListener associated with given key.void
firePostChange
(Object key, ChangeEvent cev) invoke the firePostChangeEvent on all ChangeListeners associated with a specific key.void
firePreChange
(Object key, ChangeEvent cev) invoke the firePreChangeEvent on all ChangeListeners associated with a specific key.void
removeListener
(Object key, ChangeListener listener, ChangeType ct) remove a ChangeListener associated with given key.
-
Method Details
-
addListener
add a ChangeListener associated with given key. -
removeListener
remove a ChangeListener associated with given key. -
firePreChange
invoke the firePreChangeEvent on all ChangeListeners associated with a specific key.- Throws:
ChangeVetoException
-
firePostChange
invoke the firePostChangeEvent on all ChangeListeners associated with a specific key.
-