Package org.biojava.bio.seq.db.flat
Class FlatSequenceDB
- java.lang.Object
-
- org.biojava.utils.Unchangeable
-
- org.biojava.bio.seq.db.flat.FlatSequenceDB
-
- All Implemented Interfaces:
SequenceDBLite,Changeable
public class FlatSequenceDB extends Unchangeable implements SequenceDBLite
FlatSequenceDBis an OBDA flatfile sequence databank implementation. It is backed by an index created using theorg.biojava.bio.program.indexdbpackage.- Author:
- Keith James
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
-
-
Constructor Summary
Constructors Constructor Description FlatSequenceDB(String location, String dbName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSequence(Sequence sequence)addSequencealways throws aChangeVetoExceptionas this implementation is immutable.StringgetName()Get the name of this sequence database.SequencegetSequence(String id)Retrieve a single sequence by its id.voidremoveSequence(String id)removeSequencealways throws aChangeVetoExceptionas this implementation is immutable.-
Methods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder
-
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
-
-
-
-
Constructor Detail
-
FlatSequenceDB
public FlatSequenceDB(String location, String dbName) throws IOException, BioException
- Throws:
IOExceptionBioException
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:SequenceDBLiteGet the name of this sequence database.- Specified by:
getNamein interfaceSequenceDBLite- Returns:
- the name of the sequence database, which may be null.
-
getSequence
public Sequence getSequence(String id) throws IllegalIDException, BioException
Description copied from interface:SequenceDBLiteRetrieve a single sequence by its id.- Specified by:
getSequencein interfaceSequenceDBLite- Parameters:
id- the id to retrieve by- Returns:
- the Sequence with that id
- Throws:
IllegalIDException- if the database doesn't know about the idBioException- if there was a failure in retrieving the sequence
-
addSequence
public void addSequence(Sequence sequence) throws ChangeVetoException
addSequencealways throws aChangeVetoExceptionas this implementation is immutable.- Specified by:
addSequencein interfaceSequenceDBLite- Parameters:
sequence- aSequence.- Throws:
ChangeVetoException
-
removeSequence
public void removeSequence(String id) throws ChangeVetoException
removeSequencealways throws aChangeVetoExceptionas this implementation is immutable.- Specified by:
removeSequencein interfaceSequenceDBLite- Parameters:
id- aString.- Throws:
ChangeVetoException
-
-