org.biojava.bio.seq.db
Class SequenceDBWrapper
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.seq.db.AbstractSequenceDB
org.biojava.bio.seq.db.SequenceDBWrapper
- All Implemented Interfaces:
- Serializable, SequenceDB, SequenceDBLite, Changeable
- Direct Known Subclasses:
- CachingSequenceDB, SubSequenceDB, ViewingSequenceDB
public abstract class SequenceDBWrapper
- extends AbstractSequenceDB
- implements Serializable
An abstract implementation of SequenceDB that wraps up another database.
- Author:
- Matthew Pocock
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.biojava.bio.seq.db.SequenceDB |
ids |
SequenceDBWrapper
public SequenceDBWrapper(SequenceDB parent)
getChangeSupport
protected ChangeSupport getChangeSupport(ChangeType ct)
- Description copied from class:
AbstractChangeable
- Called to retrieve the ChangeSupport for this object.
Your implementation of this method should have the following structure:
ChangeSupport cs = super.getChangeSupport(ct);
if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
someForwarder = new ChangeForwarder(...
this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
}
return cs;
It is usual for the forwarding listeners (someForwarder in this example) to
be transient and lazily instantiated. Be sure to register & unregister the
forwarder in the code that does the ChangeEvent handling in setter methods.
- Overrides:
getChangeSupport
in class AbstractChangeable
getParent
public SequenceDB getParent()
- Return the parent SequenceDB.
- Returns:
- the parent SequenceDB