## 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.

Field Summary
`static ChangeType` `DATASOURCE`
`static ChangeType` `DATASOURCE_SELECTION`

Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite
`SEQUENCES`

Constructor Summary
`DistributedSequenceDB()`

Method Summary
`void` `addDataSource(DistDataSource dds)`
`void` `addSequence(Sequence seq)` Adds a sequence to the database.
`FeatureHolder` `filter(FeatureFilter ff)` Query features attached to all sequences in this database.
`protected ChangeSupport` `getChangeSupport()`
`java.util.Set` `getDataSources()`
`java.lang.String` `getName()` Get the name of this sequence database.
`Sequence` `getSequence(java.lang.String id)` Retrieve a single sequence by its id.
`protected boolean` `hasChangeSupport()`
`java.util.Set` `ids()` Get an immutable set of all of the IDs in the database.
`void` `removeDataSource(DistDataSource dds)`
`void` `removeSequence(java.lang.String id)` Remove the sequence associated with an ID from the database.

Methods inherited from class org.biojava.bio.seq.db.AbstractSequenceDB
`sequenceIterator`

Methods inherited from class org.biojava.utils.AbstractChangeable
`addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, 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.bio.seq.db.SequenceDB
`sequenceIterator`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Field Detail

### DATASOURCE

    public static final ChangeType DATASOURCE

### DATASOURCE_SELECTION

    public static final ChangeType DATASOURCE_SELECTION

Constructor Detail

### DistributedSequenceDB

    public DistributedSequenceDB()

Method Detail

### hasChangeSupport

    protected boolean hasChangeSupport()

### getChangeSupport

    protected ChangeSupport getChangeSupport()

### getDataSources

    public java.util.Set getDataSources()

### addDataSource

    public void addDataSource(DistDataSource dds)
                       throws ChangeVetoException

  Throws:
    `ChangeVetoException`

### removeDataSource

    public void removeDataSource(DistDataSource dds)
                          throws ChangeVetoException

  Throws:
    `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`
  Throws:
    `ChangeVetoException`

### 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`
  Throws:
    `ChangeVetoException`

### 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`