T - the token type of the underlying data sourcepublic class StringAdapter<T> extends CharSequenceAdapter<T>
CharSequenceAdapter returns views. Therefore
CharSequenceAdapter should be used instead if possible for large sequences to save memory.| Constructor and Description |
|---|
StringAdapter(AlignmentModel<T> underlyingProvider,
boolean cutLongRepresentations)
Creates a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getSequence(java.lang.String sequenceID)
Returns a string copy of the sequence with the specified ID in the underlying data source.
|
java.lang.String |
getSubSequence(java.lang.String sequenceID,
int offset,
int length)
Returns a string copy of a subsequence of the sequence with the specified ID in the underlying
data source.
|
boolean |
returnsCopies()
Returns
true since this class always returns copies of the data in the underlying data source. |
isCutLongRepresentationsgetUnderlyingModel, setUnderlyingModelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUnderlyingModelpublic StringAdapter(AlignmentModel<T> underlyingProvider, boolean cutLongRepresentations)
provider - the sequence data provider that contains the sequences to be viewedcutLongRepresentations - Specify true here if the first character of string
representations (of tokens in the underlying sequence data provider) that are longer than
one character shall be used for translations or false if an
InvalidUnderlyingTokenException shall be thrown if such a token occurs.public java.lang.String getSequence(java.lang.String sequenceID)
getSequence in interface SequenceAccess<java.lang.CharSequence>getSequence in class CharSequenceAdapter<T>sequenceID - the ID of the sequence to be viewedpublic java.lang.String getSubSequence(java.lang.String sequenceID, int offset, int length)
getSubSequence in interface SequenceDataAdapter<java.lang.CharSequence,T>getSubSequence in class CharSequenceAdapter<T>sequenceID - the ID of the sequence to be viewedoffset - the start index of the subsequence to be viewed (The first token has the index 0.)length - the length of the subsequence to be viewedpublic boolean returnsCopies()
true since this class always returns copies of the data in the underlying data source.returnsCopies in interface SequenceDataAdapter<java.lang.CharSequence,T>returnsCopies in class CharSequenceAdapter<T>true