public class DummySequenceDB extends AbstractSequenceDB implements SequenceDB
DummySequenceDB
is an implementation which contains
only a DummySequence
. It will return the same
DummySequence
instance regardless of the sequence id
used to retrieve a sequence.SEQUENCES
Constructor and Description |
---|
DummySequenceDB(String name) |
Modifier and Type | Method and Description |
---|---|
void |
addSequence(Sequence seq)
Adds a sequence to the database.
|
String |
getName()
Get the name of this sequence database.
|
Sequence |
getSequence(String id)
Retrieve a single sequence by its id.
|
Set |
ids()
Get an immutable set of all of the IDs in the 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.
|
filter
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
filter
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public DummySequenceDB(String name)
public Set ids()
SequenceDB
ids
in interface SequenceDB
public SequenceIterator sequenceIterator()
SequenceDB
sequenceIterator
in interface SequenceDB
sequenceIterator
in class AbstractSequenceDB
public String getName()
SequenceDBLite
getName
in interface SequenceDBLite
public Sequence getSequence(String id) throws IllegalIDException, BioException
SequenceDBLite
getSequence
in interface SequenceDBLite
id
- the id to retrieve byIllegalIDException
- if the database doesn't know about the idBioException
- if there was a failure in retrieving the sequencepublic void addSequence(Sequence seq) throws IllegalIDException, BioException, ChangeVetoException
SequenceDBLite
addSequence
in interface SequenceDBLite
addSequence
in class AbstractSequenceDB
seq
- the Sequence to addIllegalIDException
- 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 vetoedpublic void removeSequence(String id) throws IllegalIDException, BioException, ChangeVetoException
SequenceDBLite
removeSequence
in interface SequenceDBLite
removeSequence
in class AbstractSequenceDB
id
- the ID of the sequence to removeIllegalIDException
- 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 vetoedCopyright © 2014 BioJava. All rights reserved.