T - the token type that is used by the underlying alignment modelpublic class SingleCharSequenceAdapter<T> extends AbstractSingleSequenceDataAdapter<T> implements java.lang.CharSequence, SingleSequenceDataAdapter<T>
AlignmentModel as a CharSequence.
Note this implementation directly delegates to the underlying alignment model so that all changes there automatically affect the instance of this class.
| Constructor and Description |
|---|
SingleCharSequenceAdapter(AlignmentModel<T> underlyingModel,
java.lang.String sequenceID,
boolean cutLongRepresentations)
Creates a new instance of this class specifying a whole sequence to be viewed.
|
SingleCharSequenceAdapter(AlignmentModel<T> underlyingModel,
java.lang.String sequenceID,
int offset,
int length,
boolean cutLongRepresentations)
Creates a new instance of this class specifying a subsequence to be viewed.
|
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index)
Returns the character representation of the token in the underlying data source at the specified position.
|
boolean |
isCutLongRepresentations()
The return values indicates whether string representations of tokens that are not exactly one character
long are allowed.
|
int |
length()
This method delegates to
AbstractSingleSequenceDataAdapter.getLength(). |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString()
Returns a copy of this character sequence as a string.
|
getLength, getOffset, getSequenceID, setLength, setOffset, setSequenceIDgetUnderlyingModel, setUnderlyingModelclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetLength, getOffset, getSequenceIDgetUnderlyingModelpublic SingleCharSequenceAdapter(AlignmentModel<T> underlyingModel, java.lang.String sequenceID, int offset, int length, boolean cutLongRepresentations)
underlyingModel - the alignment model that contains the sequence to be viewedsequenceID - the ID used in provider 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 viewedcutLongRepresentations - Specify true here if tokens that have a string representation
that is not exactly one character long shall be exported with the first character of their
representation or false if an exception shall be thrown if such a token is found.public SingleCharSequenceAdapter(AlignmentModel<T> underlyingModel, java.lang.String sequenceID, boolean cutLongRepresentations)
underlyingModel - the alignment model that contains the sequence to be viewedsequenceID - the ID used in provider of the sequence to be viewedcutLongRepresentations - Specify true here if tokens that have a string representation
that is not exactly one character long shall be exported with the first character of their
representation or false if an exception shall be thrown if such a token is found.public boolean isCutLongRepresentations()
true if tokens that have a string representation that is not exactly one character long
shall be exported with the first character of their representation or false if an exception
shall be thrown if such a token is foundpublic char charAt(int index) throws InvalidUnderlyingTokenException, java.lang.IndexOutOfBoundsException
charAt in interface java.lang.CharSequenceInvalidUnderlyingTokenException - if the underlying token has a string representation that is
not exactly one character long and isCutLongRepresentations() was set to falsejava.lang.IndexOutOfBoundsException - if index was < 0 or >= length()CharSequence.charAt(int)public int length()
AbstractSingleSequenceDataAdapter.getLength().length in interface java.lang.CharSequencepublic java.lang.CharSequence subSequence(int start, int end)
subSequence in interface java.lang.CharSequencepublic java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.ObjectInvalidUnderlyingTokenException - if one token in the underlying data source has a string
representation that is not exactly one character long and isCutLongRepresentations()
was set to false