public class CharSequenceAlignmentModel extends AbstractUnmodifyableAlignmentModel<java.lang.CharSequence,java.lang.Character> implements SequenceAccessAlignmentModel<java.lang.CharSequence,java.lang.Character>
AlignmentModel
backed by a set of CharSequence
implementations
(e.g. String
objects).
This class does not allow to write tokens (characters) since this is not supported by the
CharSequence
interface. If you use a character sequence implementation that supports writing
you can subclass this class and overwrite the methods that edit tokens.
Constructor and Description |
---|
CharSequenceAlignmentModel(TokenSet<java.lang.Character> tokenSet)
Creates a new instance of this class using its own ID manager.
|
CharSequenceAlignmentModel(TokenSet<java.lang.Character> tokenSet,
SequenceIDManager idManager,
boolean reuseSequenceIDs)
Creates a new instance of this class using a possibly shared ID manager.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.CharSequence |
createNewSequence(java.lang.String sequenceID,
java.lang.String sequenceName)
Returns an empty string as the new character sequence.
|
int |
getSequenceLength(java.lang.String sequenceID)
Returns the length of the specified sequence.
|
java.lang.Character |
getTokenAt(java.lang.String sequenceID,
int index)
Returns the token at the specified position.
|
addSequence, getSequence, getWriteType, insertTokenAt, insertTokensAt, removeTokenAt, removeTokensAt, replaceSequence, setTokenAt, setTokensAt
containsSequence, doAddSequence, doRemoveSequence, getSequenceCount, getSequenceMap, getSequenceOrder, sequenceIDIterator
addSequence, addSequence, appendToken, appendTokens, doRenameSequence, fireAfterSequenceChange, fireAfterTokenChange, getApproxMaxSequenceLength, getIDManager, getMaxSequenceLength, getTokenSet, isReuseSequenceIDs, isSequencesReadOnly, isTokensReadOnly, removeSequence, renameSequence, sequenceIDsByName, sequenceNameByID, setMaxSequeceLengthRecalculte, setReuseSequenceIDs, setTokenSet
fireAfterSequenceRenamed, getChangeListeners, getID, getLabel, setID, setLabel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSequence, replaceSequence
addSequence, addSequence, appendToken, appendTokens, containsSequence, getChangeListeners, getID, getLabel, getMaxSequenceLength, getSequenceCount, getTokenSet, getWriteType, insertTokenAt, insertTokensAt, isSequencesReadOnly, isTokensReadOnly, removeSequence, removeTokenAt, removeTokensAt, renameSequence, sequenceIDIterator, sequenceIDsByName, sequenceNameByID, setID, setLabel, setTokenAt, setTokensAt, setTokenSet
getSequence
public CharSequenceAlignmentModel(TokenSet<java.lang.Character> tokenSet, SequenceIDManager idManager, boolean reuseSequenceIDs)
tokenSet
- the token set which is supported by the implementationidManager
- the ID manager to be used by the new instance (maybe shared among multiple instances)reuseSequenceIDs
- Specifies whether unused IDs of the underlying ID manager should be reused by this model.
(See the documentation of AbstractUndecoratedAlignmentModel.isReuseSequenceIDs()
for details. Specify false
, if you are unsure
what this property does.)public CharSequenceAlignmentModel(TokenSet<java.lang.Character> tokenSet)
tokenSet
- the token set which is supported by the implementationprotected java.lang.CharSequence createNewSequence(java.lang.String sequenceID, java.lang.String sequenceName)
createNewSequence
in class AbstractMapBasedAlignmentModel<java.lang.CharSequence,java.lang.Character>
sequenceID
- the ID the new sequence must havesequenceName
- the name the new sequence will havepublic int getSequenceLength(java.lang.String sequenceID)
AlignmentModel
getSequenceLength
in interface AlignmentModel<java.lang.Character>
sequenceID
- the identifier the sequence in the alignment-1
if no sequence with the specified name existspublic java.lang.Character getTokenAt(java.lang.String sequenceID, int index)
AlignmentModel
getTokenAt
in interface AlignmentModel<java.lang.Character>
sequenceID
- the identifier the sequence where the token is containedindex
- the index of the element contained in the specified sequence (The first element has the index 0.)