Package org.biojava.bio.seq.db
Class DummySequenceDBInstallation
- java.lang.Object
-
- org.biojava.bio.seq.db.DummySequenceDBInstallation
-
- All Implemented Interfaces:
SequenceDBInstallation
public class DummySequenceDBInstallation extends Object implements SequenceDBInstallation
DummySequenceDBInstallation
is an implementation which returns the sameDummySequenceDB
instance regardless of the identifier used to retrieve a database.- Since:
- 1.2
- Author:
- Keith James
-
-
Constructor Summary
Constructors Constructor Description DummySequenceDBInstallation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSequenceDB(SequenceDBLite sequenceDB, Set otherIdentifiers)
As this is a dummy implementation adding a sequenceDB doesn't do anythingSequenceDBLite
getSequenceDB(String identifier)
Return the SequenceDB for the given identifier.Set
getSequenceDBs()
Return all sequence dbs available in this sequence db installation.
-
-
-
Constructor Detail
-
DummySequenceDBInstallation
public DummySequenceDBInstallation()
-
-
Method Detail
-
getSequenceDB
public SequenceDBLite getSequenceDB(String identifier)
Description copied from interface:SequenceDBInstallation
Return the SequenceDB for the given identifier. The identifier can (but need not) be the name of the sequence db. An implementation may support any number of identifiers to (uniquely) identify a particular sequence db - but the name of the sequence db (returned by SequenceDB.getName()) must always be among them.
If the sequence db identified by the given identifier has not been requested through this object, it will be created and returned (hence this method is a factory method). If the sequence db identified by the given identifier has already been requested, the same object is returned.
- Specified by:
getSequenceDB
in interfaceSequenceDBInstallation
- Parameters:
identifier
- the string that identifies the sequence db. May not be null.- Returns:
- the SequenceDB object that matches the given identifier or null if no such SequenceDB object could be found. (It is the responsibility of the implementation to take care that all identifiers are unique so if it turns out that the given identifier identifies more than one sequence db, this method should throw a RuntimeException.)
-
getSequenceDBs
public Set getSequenceDBs()
Description copied from interface:SequenceDBInstallation
Return all sequence dbs available in this sequence db installation. This is not just the set of sequence dbs already returned by getSequenceDB() but the entire set of sequence dbs supported by this object.- Specified by:
getSequenceDBs
in interfaceSequenceDBInstallation
- Returns:
- a set of SequenceDB objects which may be empty. An implementation may also return null if it is not at all possible to determine which sequence dbs are part of this installation.
-
addSequenceDB
public void addSequenceDB(SequenceDBLite sequenceDB, Set otherIdentifiers)
As this is a dummy implementation adding a sequenceDB doesn't do anything- Specified by:
addSequenceDB
in interfaceSequenceDBInstallation
- Parameters:
sequenceDB
- aSequenceDB
.otherIdentifiers
- aSet
.
-
-