public class HashSequenceDB extends AbstractSequenceDB implements SequenceDB, Serializable
SEQUENCES
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
filter
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
filter
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
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 databasepublic String getName()
SequenceDBLite
getName
in interface SequenceDBLite
public Sequence getSequence(String id) throws IllegalIDException
SequenceDBLite
getSequence
in interface SequenceDBLite
id
- the id to retrieve byIllegalIDException
- 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 addChangeVetoException
- 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 addChangeVetoException
- 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 removeIllegalIDException
- if there is no sequence for the IDBioException
- if something failed while removing the sequence for
that IDChangeVetoException
- if either the database does not allow
sequences to be removed or the modification was vetoedCopyright © 2014 BioJava. All rights reserved.