public class CharSubSequence extends AbstractCharSequence
Modifier and Type | Class and Description |
---|---|
static class |
CharSubSequence.StringLike
Subclass providing string-like implementation
of
hashCode() and equals()
method accepting strings with the same content
like charsequence has. |
Constructor and Description |
---|
CharSubSequence(CharSequence backingSequence,
int start,
int end)
Construct character subsequence with the given backing character sequence.
|
Modifier and Type | Method and Description |
---|---|
protected CharSequence |
backingSequence() |
char |
charAt(int index)
Returns the character at the specified index.
|
static void |
checkIndexesValid(CharSequence text,
int start,
int end)
Deprecated.
|
int |
length()
Returns the length of this character sequence.
|
protected int |
start() |
subSequence, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
public CharSubSequence(CharSequence backingSequence, int start, int end)
backingSequence
- non-null backing character sequence. It is considered
to be stable and not to change over time.start
- >=0 starting index of the subsequence within
the backing character sequence.end
- >= ending index of the subsequence within
the backing character sequence.IndexOutOfBoundsException
- if the start or end are not within bounds
of backingSequence.public static void checkIndexesValid(CharSequence text, int start, int end)
CharSequenceUtilities.checkIndexesValid(CharSequence, int, int)
IndexOutOfBoundsException
- if the start or end are not within bounds
of the given text.protected CharSequence backingSequence()
protected int start()
public int length()
AbstractCharSequence
length
in interface CharSequence
length
in class AbstractCharSequence
public char charAt(int index)
AbstractCharSequence
charAt
in interface CharSequence
charAt
in class AbstractCharSequence
index
- the index of the character to be returned