org.biojava.bio.seq.db.flat
Class FlatSequenceDB

java.lang.Object
  extended byorg.biojava.utils.Unchangeable
      extended byorg.biojava.bio.seq.db.flat.FlatSequenceDB
All Implemented Interfaces:
Changeable, SequenceDBLite

public class FlatSequenceDB
extends Unchangeable
implements SequenceDBLite

FlatSequenceDB is an OBDA flatfile sequence databank implementation. It is backed by an index created using the org.biojava.bio.program.indexdb package.

Author:
Keith James

Field Summary
 
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES
 
Constructor Summary
FlatSequenceDB(java.lang.String location, java.lang.String dbName)
           
 
Method Summary
 void addSequence(Sequence sequence)
          addSequence always throws a ChangeVetoException as this implementation is immutable.
 java.lang.String getName()
          Get the name of this sequence database.
 Sequence getSequence(java.lang.String id)
          Retrieve a single sequence by its id.
 void removeSequence(java.lang.String id)
          removeSequence always throws a ChangeVetoException as 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(java.lang.String location,
                      java.lang.String dbName)
               throws java.io.IOException,
                      BioException
Method Detail

getName

public java.lang.String getName()
Description copied from interface: SequenceDBLite
Get the name of this sequence database.

Specified by:
getName in interface SequenceDBLite
Returns:
the name of the sequence database, which may be null.

getSequence

public Sequence getSequence(java.lang.String id)
                     throws IllegalIDException,
                            BioException
Description copied from interface: SequenceDBLite
Retrieve a single sequence by its id.

Specified by:
getSequence in interface SequenceDBLite
Returns:
the Sequence with that id
Throws:
BioException - if there was a failure in retrieving the sequence
IllegalIDException - if the database doesn't know about the id

addSequence

public void addSequence(Sequence sequence)
                 throws ChangeVetoException
addSequence always throws a ChangeVetoException as this implementation is immutable.

Specified by:
addSequence in interface SequenceDBLite
Parameters:
sequence - a Sequence.
Throws:
ChangeVetoException

removeSequence

public void removeSequence(java.lang.String id)
                    throws ChangeVetoException
removeSequence always throws a ChangeVetoException as this implementation is immutable.

Specified by:
removeSequence in interface SequenceDBLite
Parameters:
id - a String.
Throws:
ChangeVetoException