|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.bio.seq.db.AbstractSequenceDB
org.biojava.bio.seq.db.HashSequenceDB
public class HashSequenceDB
An implementation of SequenceDB that uses an underlying HashMap to store the sequence objects.
Field Summary |
---|
Fields inherited from interface org.biojava.bio.seq.db.SequenceDBLite |
---|
SEQUENCES |
Constructor Summary | |
---|---|
HashSequenceDB()
Generate a HashSequenceDB object that will use byName to generate ids for sequences and have a null name. |
|
HashSequenceDB(IDMaker idMaker)
Generate a HashSequenceDB object that will use idMaker to generate ids for sequences and have a null name. |
|
HashSequenceDB(IDMaker idMaker,
String name)
Generate a HashSequenceDB object that will use idMaker to generate ids for sequences and have the requested name. |
|
HashSequenceDB(String name)
Generate a HashSequenceDB object that will use byName to generate ids and will have the requested name. |
Method Summary | |
---|---|
void |
addSequence(Sequence seq)
Adds a sequence to the database. |
void |
addSequence(String id,
Sequence seq)
Add a sequence under a particular id. |
IDMaker |
getIDMaker()
Retrieve the IDMaker associated with this database. |
String |
getName()
Get the name of this sequence database. |
Sequence |
getSequence(String id)
Retrieve a single sequence by its id. |
Set |
ids()
Get an immutable set of all of the IDs in the database. |
void |
removeSequence(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 org.biojava.bio.seq.db.AbstractSequenceDB |
---|
filter |
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.bio.seq.db.SequenceDB |
---|
filter |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Constructor Detail |
---|
public HashSequenceDB()
public HashSequenceDB(IDMaker idMaker)
idMaker
- the object that will work out the default id for a sequencepublic HashSequenceDB(String name)
name
- the name for this databasepublic HashSequenceDB(IDMaker idMaker, String name)
idMaker
- the object that will work out the default id for a sequencename
- the name for this databaseMethod Detail |
---|
public String getName()
SequenceDBLite
getName
in interface SequenceDBLite
public Sequence getSequence(String id) throws IllegalIDException
SequenceDBLite
getSequence
in interface SequenceDBLite
id
- the id to retrieve by
IllegalIDException
- if the database doesn't know about the idpublic Set ids()
SequenceDB
ids
in interface SequenceDB
public SequenceIterator sequenceIterator()
SequenceDB
sequenceIterator
in interface SequenceDB
sequenceIterator
in class AbstractSequenceDB
public void addSequence(String id, Sequence seq) throws ChangeVetoException
id
- the id to useseq
- the Sequence to add
ChangeVetoException
- if this addition was vetoedpublic IDMaker getIDMaker()
public void addSequence(Sequence seq) throws ChangeVetoException
SequenceDBLite
addSequence
in interface SequenceDBLite
addSequence
in class AbstractSequenceDB
seq
- the Sequence to add
ChangeVetoException
- if either the database does not allow
sequences to be added or the modification was vetoedpublic void removeSequence(String id) throws BioException, ChangeVetoException
SequenceDBLite
removeSequence
in interface SequenceDBLite
removeSequence
in class AbstractSequenceDB
id
- the ID of the sequence to remove
IllegalIDException
- if there is no sequence for the ID
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |