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 TypeMethodDescriptionvoid
Add a distributed data source.void
addSequence
(Sequence seq) Adds a sequence to the database.protected ChangeSupport
Get 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 boolean
ids()
Get an immutable set of all of the IDs in the database.void
Remove a distributed data source.void
removeSequence
(String id) Remove the sequence associated with an ID from the database.Methods inherited from class org.biojava.bio.seq.db.AbstractSequenceDB
filter, sequenceIterator
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.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
Methods 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:SequenceDBLite
Get the name of this sequence database.- Specified by:
getName
in interfaceSequenceDBLite
- Returns:
- the name of the sequence database, which may be null.
-
addSequence
Description copied from interface:SequenceDBLite
Adds a sequence to the database.- Specified by:
addSequence
in interfaceSequenceDBLite
- Overrides:
addSequence
in 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:SequenceDBLite
Remove the sequence associated with an ID from the database.- Specified by:
removeSequence
in interfaceSequenceDBLite
- Overrides:
removeSequence
in 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:SequenceDBLite
Retrieve a single sequence by its id.- Specified by:
getSequence
in 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:SequenceDB
Get an immutable set of all of the IDs in the database. The ids are legal arguments to getSequence.- Specified by:
ids
in interfaceSequenceDB
- Returns:
- a Set of ids - at the moment, strings
-