T
- the token type used by the underlying providerpublic class CharSequenceAdapter<T> extends AbstractBasicAlignmentModelView<T> implements SequenceDataAdapter<java.lang.CharSequence,T>
AlignmentModel
as a set of CharSequence
s or String
s.Constructor and Description |
---|
CharSequenceAdapter(AlignmentModel<T> underlyingProvider,
boolean cutLongRepresentations)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.CharSequence |
getSequence(java.lang.String sequenceID)
Returns an implementation of
SingleCharSequenceAdapter<T> that acts as a view to the sequence
with the specified ID. |
java.lang.CharSequence |
getSubSequence(java.lang.String sequenceID,
int offset,
int length)
Returns an implementation of
SingleCharSequenceAdapter<T> that acts as a view to a subsequence
of the sequence with the specified ID. |
boolean |
isCutLongRepresentations()
Returns
true 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. |
boolean |
returnsCopies()
Returns
false since this class always returns views of the underlying data source. |
getUnderlyingModel, setUnderlyingModel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUnderlyingModel
public CharSequenceAdapter(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 boolean isCutLongRepresentations()
true
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.cutLongRepresentations
in the constructorpublic java.lang.CharSequence getSequence(java.lang.String sequenceID)
SingleCharSequenceAdapter<T>
that acts as a view to the sequence
with the specified ID.getSequence
in interface SequenceAccess<java.lang.CharSequence>
sequenceID
- the ID of the sequence to be viewedCharSequence
public java.lang.CharSequence getSubSequence(java.lang.String sequenceID, int offset, int length)
SingleCharSequenceAdapter<T>
that acts as a view to a subsequence
of the sequence with the specified ID.getSubSequence
in interface SequenceDataAdapter<java.lang.CharSequence,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 viewedCharSequence
public boolean returnsCopies()
false
since this class always returns views of the underlying data source.returnsCopies
in interface SequenceDataAdapter<java.lang.CharSequence,T>
false