org.biojava.bio.seq.db
Class SimpleSequenceDBInstallation
java.lang.Object
|
+--org.biojava.bio.seq.db.SimpleSequenceDBInstallation
- public class SimpleSequenceDBInstallation
- extends java.lang.Object
- implements SequenceDBInstallation
this class is an implementation of interface SequenceDBInstallation that manages a set of HashSequenceDB objects. The
set of HashSequenceDB objects is initially empty and can be expanded by the user through the addSequenceDB() method.
This SequenceDBInstallation is then able to serve the HashSequenceDB objects in this set.
- Author:
- Gerald Loeffler for the
IMP
Method Summary |
void |
addSequenceDB(java.lang.String name,
java.util.Set otherIdentifiers)
this method creates a new (and empty) HashSequenceDB with the given name that will be accessible through this
sequence db installation through this name and all given other identifiers. |
boolean |
equals(java.lang.Object o)
|
SequenceDB |
getSequenceDB(java.lang.String identifier)
if the given identifier is known to this sequence db installation because it has been used in a call to
addSequenceDB(), then this method returns the SequenceDB associated with this identifier. |
java.util.Set |
getSequenceDBs()
return a newly created set of the SequenceDB objects that were already created through method addSequenceDB(). |
int |
hashCode()
|
static void |
main(java.lang.String[] args)
test this class |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
SimpleSequenceDBInstallation
public SimpleSequenceDBInstallation()
- create an initially empty SimpleSequenceDBInstallation
addSequenceDB
public void addSequenceDB(java.lang.String name,
java.util.Set otherIdentifiers)
- this method creates a new (and empty) HashSequenceDB with the given name that will be accessible through this
sequence db installation through this name and all given other identifiers.
- Parameters:
name
- the name of the SequenceDB to create. Not null. If this name is lready used by this sequence db
installation, an IllegalArgumentException is thrown.otherIdentifiers
- a set of String objects that also serve as identifiers for the newly created SequenceDB
object. This set should not contain the name of the SequenceDB - but if if does, it is just
ignored because the name is an identifier by definition. The parameter may be empty or the
empty set, in which case the name is the only identifier for the newly created SequenceDB.
If any of the given identifiers (including the name) is already used by this sequence db
installation, an IllegalArgumentException is thrown.
getSequenceDBs
public java.util.Set getSequenceDBs()
- return a newly created set of the SequenceDB objects that were already created through method addSequenceDB(). This
set itself is not part of the state of this object (i.e. modifying the set does not modify this object) but the
SequenceDB objects contained in the set are the same objects managed by this object.
- Specified by:
- getSequenceDBs in interface SequenceDBInstallation
- Tags copied from interface: SequenceDBInstallation
- 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.
getSequenceDB
public SequenceDB getSequenceDB(java.lang.String identifier)
- if the given identifier is known to this sequence db installation because it has been used in a call to
addSequenceDB(), then this method returns the SequenceDB associated with this identifier. Otherwise, null
is returned.
- Specified by:
- getSequenceDB in interface SequenceDBInstallation
- Tags copied from interface: SequenceDBInstallation
- 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.)
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
- equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
- hashCode in class java.lang.Object
main
public static void main(java.lang.String[] args)
- test this class