org.biojava.bio.seq.distributed
Class DistributedSequenceDB
java.lang.Object
|
+--org.biojava.utils.AbstractChangeable
|
+--org.biojava.bio.seq.db.AbstractSequenceDB
|
+--org.biojava.bio.seq.distributed.DistributedSequenceDB
- All Implemented Interfaces:
- Changeable, SequenceDB, SequenceDBLite
- public class DistributedSequenceDB
- extends AbstractSequenceDB
- implements SequenceDB
Sequence database from the meta-DAS system.
- Since:
- 1.2
- Author:
- Thomas Down, Matthew Pocock
- For general use:
- Once you've made one of these and populated it with a few DistDataSource instances,
you should be able to prety much forget about it and use it directly as a normal
SequenceDB implementation.
- For advanced users:
- DataSources can be added and removed while the object is live.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATASOURCE
public static final ChangeType DATASOURCE
DATASOURCE_SELECTION
public static final ChangeType DATASOURCE_SELECTION
DistributedSequenceDB
public DistributedSequenceDB()
hasChangeSupport
protected boolean hasChangeSupport()
getChangeSupport
protected ChangeSupport getChangeSupport()
getDataSources
public java.util.Set getDataSources()
addDataSource
public void addDataSource(DistDataSource dds)
throws ChangeVetoException
ChangeVetoException
removeDataSource
public void removeDataSource(DistDataSource dds)
throws ChangeVetoException
ChangeVetoException
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.
addSequence
public void addSequence(Sequence seq)
throws ChangeVetoException
- Description copied from interface:
SequenceDBLite
- Adds a sequence to the database.
- Specified by:
addSequence in interface SequenceDBLite- Overrides:
addSequence in class AbstractSequenceDB
- Parameters:
seq - the Sequence to add
- Throws:
ChangeVetoException - if either the database does not allow
sequences to be added or the modification was vetoed
removeSequence
public void removeSequence(java.lang.String id)
throws ChangeVetoException
- Description copied from interface:
SequenceDBLite
- Remove the sequence associated with an ID from the database.
- Specified by:
removeSequence in interface SequenceDBLite- Overrides:
removeSequence in class AbstractSequenceDB
- Parameters:
id - the ID of the sequence to remove
- Throws:
ChangeVetoException - if either the database does not allow
sequences to be removed or the modification was vetoed
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
ids
public java.util.Set ids()
- Description copied from interface:
SequenceDB
- Get an immutable set of all of the IDs in the database. The ids are legal
arguments to getSequence.
- Specified by:
ids in interface SequenceDB
- Returns:
- a Set of ids - at the moment, strings
filter
public FeatureHolder filter(FeatureFilter ff)
- Description copied from interface:
SequenceDB
- Query features attached to all sequences in this database.
This is equivalent to applying
filter to all
sequences then merging the results.
- Specified by:
filter in interface SequenceDB- Overrides:
filter in class AbstractSequenceDB
- Parameters:
ff - a FeatureFilter.