Package org.biojava.bio.seq.db
Class AbstractSequenceDB
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.seq.db.AbstractSequenceDB
-
- All Implemented Interfaces:
SequenceDB
,SequenceDBLite
,Changeable
- Direct Known Subclasses:
AnnotatedSequenceDB
,DistributedSequenceDB
,DummySequenceDB
,HashSequenceDB
,IndexedSequenceDB
,SequenceDBWrapper
public abstract class AbstractSequenceDB extends AbstractChangeable implements SequenceDB
An abstract implementation of SequenceDB that provides the sequenceIterator method.- Author:
- Matthew Pocock, Thomas Down
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
-
Constructor Summary
Constructors Constructor Description AbstractSequenceDB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSequence(Sequence seq)
Adds a sequence to the database.FeatureHolder
filter(FeatureFilter ff)
Query features attached to all sequences in this database.void
removeSequence(String id)
Remove the sequence associated with an ID from the database.SequenceIterator
sequenceIterator()
Returns a SequenceIterator over all sequences in the database.-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, 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
-
AbstractSequenceDB
public AbstractSequenceDB()
-
-
Method Detail
-
sequenceIterator
public SequenceIterator sequenceIterator()
Description copied from interface:SequenceDB
Returns a SequenceIterator over all sequences in the database. The order of retrieval is undefined.- Specified by:
sequenceIterator
in interfaceSequenceDB
- Returns:
- a SequenceIterator over all sequences
-
filter
public FeatureHolder filter(FeatureFilter ff)
Description copied from interface:SequenceDB
Query features attached to all sequences in this database. This is equivalent to applyingfilter
to all sequences then merging the results.- Specified by:
filter
in interfaceSequenceDB
- Parameters:
ff
- aFeatureFilter
.
-
addSequence
public void addSequence(Sequence seq) throws BioException, ChangeVetoException
Description copied from interface:SequenceDBLite
Adds a sequence to the database.- Specified by:
addSequence
in interfaceSequenceDBLite
- Parameters:
seq
- the Sequence to add- Throws:
IllegalIDException
- if a uniqe ID could not be generated for seqBioException
- if something goes wrong with adding the sequenceChangeVetoException
- if either the database does not allow sequences to be added or the modification was vetoed
-
removeSequence
public void removeSequence(String id) throws BioException, ChangeVetoException
Description copied from interface:SequenceDBLite
Remove the sequence associated with an ID from the database.- Specified by:
removeSequence
in interfaceSequenceDBLite
- Parameters:
id
- the ID of the sequence to remove- Throws:
IllegalIDException
- if there is no sequence for the IDBioException
- if something failed while removing the sequence for that IDChangeVetoException
- if either the database does not allow sequences to be removed or the modification was vetoed
-
-