Package 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SequenceDBWrapper.SequencesForwarder
-
Field Summary
-
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
-
Constructor Summary
Constructors Constructor Description SequenceDBWrapper(SequenceDB parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ChangeSupport
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object.SequenceDB
getParent()
Return the parent SequenceDB.-
Methods inherited from class org.biojava.bio.seq.db.AbstractSequenceDB
addSequence, filter, removeSequence, sequenceIterator
-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from interface org.biojava.bio.seq.db.SequenceDB
ids
-
Methods inherited from interface org.biojava.bio.seq.db.SequenceDBLite
getName, getSequence
-
-
-
-
Constructor Detail
-
SequenceDBWrapper
public SequenceDBWrapper(SequenceDB parent)
-
-
Method Detail
-
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:
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.ChangeSupport cs = super.getChangeSupport(ct); if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) { someForwarder = new ChangeForwarder(... this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange); } return cs;
- Overrides:
getChangeSupport
in classAbstractChangeable
-
getParent
public SequenceDB getParent()
Return the parent SequenceDB.- Returns:
- the parent SequenceDB
-
-