org.biojavax.bio.db
Class AbstractBioEntryDB

java.lang.Object
  extended by org.biojava.utils.AbstractChangeable
      extended by org.biojavax.bio.db.AbstractBioEntryDB
All Implemented Interfaces:
Changeable, BioEntryDB, BioEntryDBLite
Direct Known Subclasses:
AbstractRichSequenceDB, BioSQLBioEntryDB, HashBioEntryDB

public abstract class AbstractBioEntryDB
extends AbstractChangeable
implements BioEntryDB

An abstract implementation of BioEntryDB that provides the getBioEntryIterator method.

Since:
1.5
Author:
Matthew Pocock, Thomas Down, Richard Holland

Field Summary
 
Fields inherited from interface org.biojavax.bio.db.BioEntryDBLite
BIOENTRYS
 
Constructor Summary
AbstractBioEntryDB()
           
 
Method Summary
 void addBioEntry(BioEntry seq)
          Adds a sequence to the database.
 BioEntryIterator getBioEntryIterator()
          Returns a BioEntryIterator over all BioEntrys in the database.
 void removeBioEntry(String id)
          Remove the BioEntry associated with an ID from 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.biojavax.bio.db.BioEntryDB
ids
 
Methods inherited from interface org.biojavax.bio.db.BioEntryDBLite
getBioEntry, getBioEntrys, getBioEntrys, getName
 

Constructor Detail

AbstractBioEntryDB

public AbstractBioEntryDB()
Method Detail

addBioEntry

public void addBioEntry(BioEntry seq)
                 throws IllegalIDException,
                        BioException,
                        ChangeVetoException
Description copied from interface: BioEntryDBLite
Adds a sequence to the database.

Specified by:
addBioEntry in interface BioEntryDBLite
Parameters:
seq - the BioEntry to add
Throws:
IllegalIDException - if a uniqe ID could not be generated for BioEntry
BioException - if something goes wrong with adding the BioEntry
ChangeVetoException - if either the database does not allow BioEntrys to be added or the modification was vetoed

removeBioEntry

public void removeBioEntry(String id)
                    throws IllegalIDException,
                           BioException,
                           ChangeVetoException
Description copied from interface: BioEntryDBLite
Remove the BioEntry associated with an ID from the database.

Specified by:
removeBioEntry in interface BioEntryDBLite
Parameters:
id - the ID of the BioEntry to remove
Throws:
IllegalIDException - if there is no BioEntry for the ID
BioException - if something failed while removing the BioEntry for that ID
ChangeVetoException - if either the database does not allow BioEntrys to be removed or the modification was vetoed

getBioEntryIterator

public BioEntryIterator getBioEntryIterator()
Description copied from interface: BioEntryDB
Returns a BioEntryIterator over all BioEntrys in the database. The order of retrieval is undefined.

Specified by:
getBioEntryIterator in interface BioEntryDB
Returns:
a BioEntryIterator over all BioEntrys