T
- the type of sequence elements (tokens) the implementing provider object works withpublic class ArrayListAlignmentModel<T> extends AbstractListAlignmentModel<T>
AlignmentModel
using a map of array lists to store
alignment data. The constructors offer different options to specify the initial capacity a new
ArrayList
instance.DEFAULT_INITIAL_CAPACITY
Constructor and Description |
---|
ArrayListAlignmentModel(TokenSet<T> tokenSet)
Creates a new instance of this class using
AbstractListAlignmentModel.DEFAULT_INITIAL_CAPACITY as the initial capacity
which is only used if it is lower than AbstractUndecoratedAlignmentModel.getMaxSequenceLength() to create new sequence array
lists. |
ArrayListAlignmentModel(TokenSet<T> tokenSet,
SequenceIDManager idManager,
boolean reuseSequenceIDs)
Creates a new instance of this class using
AbstractListAlignmentModel.DEFAULT_INITIAL_CAPACITY as the initial capacity
which is only used if it is lower than AbstractUndecoratedAlignmentModel.getMaxSequenceLength() to create new sequence array
lists. |
ArrayListAlignmentModel(TokenSet<T> tokenSet,
SequenceIDManager idManager,
boolean reuseSequenceIDs,
int initialCapacity,
boolean useMaxLength)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<T> |
createNewSequence(java.lang.String sequenceID,
java.lang.String sequenceName,
int initialCapacity)
This method is called by
#createNewSequence(int, String) and must be implemented by inherited classes. |
createNewSequence, getInitialCapacity, getSequence, getSequenceLength, getTokenAt, getWriteType, insertTokenAt, insertTokensAt, isUseMaxLength, removeTokenAt, removeTokensAt, 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
public ArrayListAlignmentModel(TokenSet<T> tokenSet, SequenceIDManager idManager, boolean reuseSequenceIDs)
AbstractListAlignmentModel.DEFAULT_INITIAL_CAPACITY
as the initial capacity
which is only used if it is lower than AbstractUndecoratedAlignmentModel.getMaxSequenceLength()
to create new sequence array
lists.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 ArrayListAlignmentModel(TokenSet<T> tokenSet)
AbstractListAlignmentModel.DEFAULT_INITIAL_CAPACITY
as the initial capacity
which is only used if it is lower than AbstractUndecoratedAlignmentModel.getMaxSequenceLength()
to create new sequence array
lists. The returned instance uses its own ID manager.tokenSet
- the token set which is supported by the implementationpublic ArrayListAlignmentModel(TokenSet<T> tokenSet, SequenceIDManager idManager, boolean reuseSequenceIDs, int initialCapacity, boolean useMaxLength)
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.)initialCapacity
- the initial capacity newly generated array lists will haveuseMaxLength
- Specify true
here if initialCapacity
shall only be used if it
is lower than AbstractUndecoratedAlignmentModel.getMaxSequenceLength()
to create new sequence array lists.protected java.util.List<T> createNewSequence(java.lang.String sequenceID, java.lang.String sequenceName, int initialCapacity)
AbstractListAlignmentModel
#createNewSequence(int, String)
and must be implemented by inherited classes.
In contrast to #createNewSequence(int, String)
it provides an additional parameter specifying the
initial capacity the returned list object shall have. This parameter value if set depending on the return
values of AbstractListAlignmentModel.isUseMaxLength()
either to a fixed value as specified by AbstractListAlignmentModel.getInitialCapacity()
or by the maximum length of other sequences in this provider if any of these contain more elements than
AbstractListAlignmentModel.getInitialCapacity()
.createNewSequence
in class AbstractListAlignmentModel<T>
sequenceID
- the ID the new sequence must havesequenceName
- the name the new sequence will haveinitialCapacity
- the initial capacity the returned list object shall have