|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.seq.db.biosql.BioSQLSequenceDB
SequenceDB keyed off a BioSQL database. This is an almost-complete implementation of the BioJava Sequence, SequenceDB, and Feature interfaces, and can be used in a wide range of applications.
Field Summary |
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite |
SEQUENCES |
Constructor Summary | |
BioSQLSequenceDB(java.lang.String dbURL,
java.lang.String dbUser,
java.lang.String dbPass,
java.lang.String biodatabase,
boolean create)
Connect to a BioSQL database. |
Method Summary | |
void |
addChangeListener(ChangeListener cl)
Add a listener that will be informed of all changes. |
void |
addChangeListener(ChangeListener cl,
ChangeType ct)
Add a listener that will be informed of changes of a given type. |
void |
addSequence(Sequence seq)
Adds a sequence to the database. |
void |
createDummySequence(java.lang.String id,
Alphabet alphabet,
int length)
|
FeatureHolder |
filter(FeatureFilter ff)
Query features attached to all sequences in this database. |
java.lang.String |
getName()
Get the name of this sequence database. |
Sequence |
getSequence(java.lang.String id)
Retrieve a single sequence by its id. |
java.util.Set |
ids()
Get an immutable set of all of the IDs in the database. |
boolean |
isUnchanging(ChangeType ct)
A particular ChangeType can never be raised by this Changeable. |
void |
removeChangeListener(ChangeListener cl)
Remove a listener that was interested in all types of changes. |
void |
removeChangeListener(ChangeListener cl,
ChangeType ct)
Remove a listener that was interested in a specific types of changes. |
void |
removeSequence(java.lang.String id)
Remove the sequence associated with an ID from the database. |
SequenceIterator |
sequenceIterator()
Returns a SequenceIterator over all sequences in the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BioSQLSequenceDB(java.lang.String dbURL, java.lang.String dbUser, java.lang.String dbPass, java.lang.String biodatabase, boolean create) throws BioException
dbURL
- A JDBC database URL. For example, jdbc:postgresql://localhost/thomasd_biosql
dbUser
- The username to use when connecting to the database (or an empty string).dbPass
- The password to use when connecting to the database (or an empty string).biodatabase
- The identifier of a namespace within the physical BioSQL database.create
- If the requested namespace doesn't exist, and this flag is true
,
a new namespace will be created.
BioException
- if an error occurs communicating with the databaseMethod Detail |
public java.lang.String getName()
SequenceDBLite
getName
in interface SequenceDBLite
public void createDummySequence(java.lang.String id, Alphabet alphabet, int length) throws IllegalIDException, ChangeVetoException, BioException
IllegalIDException
ChangeVetoException
BioException
public void addSequence(Sequence seq) throws IllegalIDException, ChangeVetoException, BioException
SequenceDBLite
addSequence
in interface SequenceDBLite
seq
- the Sequence to add
IllegalIDException
- if a uniqe ID could not be generated for seq
BioException
- if something goes wrong with adding the sequence
ChangeVetoException
- if either the database does not allow
sequences to be added or the modification was vetoedpublic Sequence getSequence(java.lang.String id) throws BioException, IllegalIDException
SequenceDBLite
getSequence
in interface SequenceDBLite
BioException
- if there was a failure in retrieving the sequence
IllegalIDException
- if the database doesn't know about the idpublic void removeSequence(java.lang.String id) throws IllegalIDException, ChangeVetoException, BioException
SequenceDBLite
removeSequence
in interface SequenceDBLite
id
- the ID of the sequence to remove
BioException
- if something failed while removing the sequence for
that ID
ChangeVetoException
- if either the database does not allow
sequences to be removed or the modification was vetoed
IllegalIDException
- if there is no sequence for the IDpublic java.util.Set ids()
SequenceDB
ids
in interface SequenceDB
public FeatureHolder filter(FeatureFilter ff)
SequenceDB
filter
to all
sequences then merging the results.
filter
in interface SequenceDB
ff
- a FeatureFilter
.public SequenceIterator sequenceIterator()
SequenceDB
sequenceIterator
in interface SequenceDB
public void addChangeListener(ChangeListener cl)
Changeable
addChangeListener
in interface Changeable
cl
- the ChangeListener to addpublic void addChangeListener(ChangeListener cl, ChangeType ct)
Changeable
addChangeListener
in interface Changeable
cl
- the ChangeListenerct
- the ChangeType it is to be informed ofpublic void removeChangeListener(ChangeListener cl)
Changeable
removeChangeListener
in interface Changeable
cl
- a ChangeListener to removepublic void removeChangeListener(ChangeListener cl, ChangeType ct)
Changeable
removeChangeListener
in interface Changeable
cl
- a ChangeListener to removect
- the ChangeType that it was interested inpublic boolean isUnchanging(ChangeType ct)
Changeable
A particular ChangeType can never be raised by this Changeable.
If this returns true, then it is guaranteed that change events of this type (and all child types) can never under any circumstances be fired by this Changeable instance. If it returns false, that does not mean that this type of event will or even can be raised, but that it is worth registering listeners incase.
isUnchanging
in interface Changeable
ct
- the ChangeType to check
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |