Package org.biojava.utils
Class IndexedChangeHub
- java.lang.Object
-
- org.biojava.utils.IndexedChangeHub
-
- All Implemented Interfaces:
ChangeHub
public abstract class IndexedChangeHub extends Object implements ChangeHub
implements Changeable support with a ChangeHub that stores ChangeListener by key.- Since:
- 1.3
- Author:
- Thomas Down (original implementation), David Huen (refactoring)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
IndexedChangeHub.ListenerMemento
-
Constructor Summary
Constructors Constructor Description IndexedChangeHub()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addListener(Object key, ChangeListener listener, ChangeType ct)
add a ChangeListener associated with given key.protected void
diddleQueue()
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.protected abstract boolean
isMyChangeEvent(ChangeEvent cev, IndexedChangeHub.ListenerMemento lm)
void
removeListener(Object key, ChangeListener listener, ChangeType ct)
remove a ChangeListener associated with given key.
-
-
-
Constructor Detail
-
IndexedChangeHub
public IndexedChangeHub()
-
-
Method Detail
-
isMyChangeEvent
protected abstract boolean isMyChangeEvent(ChangeEvent cev, IndexedChangeHub.ListenerMemento lm)
-
addListener
public void addListener(Object key, ChangeListener listener, ChangeType ct)
Description copied from interface:ChangeHub
add a ChangeListener associated with given key.- Specified by:
addListener
in interfaceChangeHub
-
removeListener
public void removeListener(Object key, ChangeListener listener, ChangeType ct)
Description copied from interface:ChangeHub
remove a ChangeListener associated with given key.- Specified by:
removeListener
in interfaceChangeHub
-
firePreChange
public void firePreChange(Object key, ChangeEvent cev) throws ChangeVetoException
Description copied from interface:ChangeHub
invoke the firePreChangeEvent on all ChangeListeners associated with a specific key.- Specified by:
firePreChange
in interfaceChangeHub
- Throws:
ChangeVetoException
-
firePostChange
public void firePostChange(Object key, ChangeEvent cev)
Description copied from interface:ChangeHub
invoke the firePostChangeEvent on all ChangeListeners associated with a specific key.- Specified by:
firePostChange
in interfaceChangeHub
-
diddleQueue
protected void diddleQueue()
-
-