org.biojava.bio.seq.db
Interface SequenceDB

All Known Implementing Classes:
AceSequenceDB, AnnotatedSequenceDB, CachingSequenceDB, IndexedSequenceDB, HashSequenceDB, SequenceDBAdapter

public interface SequenceDB

A database of sequences.

This may have several implementations with rich behaviour, but basicaly most of the time you will just use the interface methods to do stuff. A sequence database contains a finite number of sequences stored under unique keys.

Author:
Matthew Pocock, Gerald Loeffler, Thomas Down

Method Summary
 java.lang.String getName()
          Get the name of this sequence database.
 Sequence getSequence(java.lang.String id)
          Retrieve a single sequence by its id.
 java.util.Set ids()
          Get an imutable set of all of the IDs in the database.
 SequenceIterator sequenceIterator()
          Returns a SequenceTterator over all sequences in the database.
 

Method Detail

getName

public java.lang.String getName()
Get the name of this sequence database.
Returns:
the name of the sequence database, which may be null.

getSequence

public Sequence getSequence(java.lang.String id)
                     throws BioException
Retrieve a single sequence by its id.
Parameters:
the - id to retrieve by
Returns:
the Sequence with that id
Throws:
BioException - if for any reason the sequence could not be retrieved

ids

public java.util.Set ids()
Get an imutable set of all of the IDs in the database. The ids are legal arguments to getSequence.
Returns:
a Set of ids - at the moment, strings

sequenceIterator

public SequenceIterator sequenceIterator()
Returns a SequenceTterator over all sequences in the database. The order of retrieval is undefined.
Returns:
a SequenceIterator over all sequences