public class CharSequenceAlignmentModel extends AbstractUnmodifyableAlignmentModel<CharSequence,Character> implements SequenceAccessAlignmentModel<CharSequence,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<Character> tokenSet)
Creates a new instance of this class using its own ID manager.
|
CharSequenceAlignmentModel(TokenSet<Character> tokenSet,
SequenceIDManager idManager)
Creates a new instance of this class using a possibly shared ID manager.
|
Modifier and Type | Method and Description |
---|---|
protected CharSequence |
createNewSequence(String sequenceID,
String sequenceName)
Returns an empty string as the new character sequence.
|
int |
getSequenceLength(String sequenceID)
Returns the length of the specified sequence.
|
Character |
getTokenAt(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, appendToken, appendTokens, doRenameSequence, fireAfterSequenceChange, fireAfterTokenChange, getApproxMaxSequenceLength, getIDManager, getMaxSequenceLength, getTokenSet, isSequencesReadOnly, isTokensReadOnly, removeSequence, renameSequence, sequenceIDByName, sequenceNameByID, setMaxSequeceLengthRecalculte, setTokenSet
fireAfterSequenceRenamed, getChangeListeners, getLabel, setLabel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSequence, replaceSequence
addSequence, appendToken, appendTokens, containsSequence, getChangeListeners, getLabel, getMaxSequenceLength, getSequenceCount, getTokenSet, getWriteType, insertTokenAt, insertTokensAt, isSequencesReadOnly, isTokensReadOnly, removeSequence, removeTokenAt, removeTokensAt, renameSequence, sequenceIDByName, sequenceIDIterator, sequenceNameByID, setLabel, setTokenAt, setTokensAt, setTokenSet
getSequence
public CharSequenceAlignmentModel(TokenSet<Character> tokenSet, SequenceIDManager idManager)
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)public CharSequenceAlignmentModel(TokenSet<Character> tokenSet)
tokenSet
- the token set which is supported by the implementationprotected CharSequence createNewSequence(String sequenceID, String sequenceName)
createNewSequence
in class AbstractMapBasedAlignmentModel<CharSequence,Character>
sequenceID
- the ID the new sequence must havesequenceName
- the name the new sequence will havepublic int getSequenceLength(String sequenceID)
AlignmentModel
getSequenceLength
in interface AlignmentModel<Character>
sequenceID
- the identifier the sequence in the alignment-1
if no sequence with the specified name existspublic Character getTokenAt(String sequenceID, int index)
AlignmentModel
getTokenAt
in interface AlignmentModel<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.)