Package 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:
SequenceDB,SequenceDBLite,Changeable
Sequence database from the meta-DAS system.
- Since:
- 1.2 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. DataSources can be added and removed while the object is live.
- Author:
- Thomas Down, Matthew Pocock
-
Field Summary
FieldsFields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
SEQUENCES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a distributed data source.voidaddSequence(Sequence seq) Adds a sequence to the database.protected ChangeSupportGet the current set of all currently registered data sources.getName()Get the name of this sequence database.getSequence(String id) Retrieve a single sequence by its id.protected booleanids()Get an immutable set of all of the IDs in the database.voidRemove a distributed data source.voidremoveSequence(String id) Remove the sequence associated with an ID from the database.Methods inherited from class org.biojava.bio.seq.db.AbstractSequenceDB
filter, sequenceIteratorMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from interface org.biojava.bio.seq.db.SequenceDB
filter, sequenceIterator
-
Field Details
-
DATASOURCE
-
DATASOURCE_SELECTION
-
-
Constructor Details
-
DistributedSequenceDB
public DistributedSequenceDB()
-
-
Method Details
-
hasChangeSupport
-
getChangeSupport
-
getDataSources
Get the current set of all currently registered data sources.The returned Set is totaly independant of any future changes made to the distributed sequence DB.
- Returns:
- a new Set containing all DistDataSource instances registered at the time
-
addDataSource
Add a distributed data source.- Parameters:
dds- the DistDataSource to add- Throws:
ChangeVetoException- if the data source could not be added
-
removeDataSource
Remove a distributed data source.- Parameters:
dds- the DistributedDataSource to remove- Throws:
ChangeVetoException- if the data source could not be removed
-
getName
Description copied from interface:SequenceDBLiteGet the name of this sequence database.- Specified by:
getNamein interfaceSequenceDBLite- Returns:
- the name of the sequence database, which may be null.
-
addSequence
Description copied from interface:SequenceDBLiteAdds a sequence to the database.- Specified by:
addSequencein interfaceSequenceDBLite- Overrides:
addSequencein classAbstractSequenceDB- 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
Description copied from interface:SequenceDBLiteRemove the sequence associated with an ID from the database.- Specified by:
removeSequencein interfaceSequenceDBLite- Overrides:
removeSequencein classAbstractSequenceDB- 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
Description copied from interface:SequenceDBLiteRetrieve a single sequence by its id.- Specified by:
getSequencein interfaceSequenceDBLite- Parameters:
id- the id to retrieve by- Returns:
- the Sequence with that id
- Throws:
IllegalIDException- if the database doesn't know about the idBioException- if there was a failure in retrieving the sequence
-
ids
Description copied from interface:SequenceDBGet an immutable set of all of the IDs in the database. The ids are legal arguments to getSequence.- Specified by:
idsin interfaceSequenceDB- Returns:
- a Set of ids - at the moment, strings
-