public class AlteredCharSequence extends Object implements CharSequence, GetChars
Modifier and Type | Method and Description |
---|---|
char |
charAt(int off)
Returns the character at the specified index, with the first character
having index zero.
|
void |
getChars(int start,
int end,
char[] dest,
int off)
Exactly like String.getChars(): copy chars
start
through end - 1 from this CharSequence into dest
beginning at offset destoff . |
int |
length()
Returns the number of characters in this sequence.
|
static AlteredCharSequence |
make(CharSequence source,
char[] sub,
int substart,
int subend)
Create an AlteredCharSequence whose text (and possibly spans)
are mirrored from
source , except that the range of
offsets substart inclusive to subend exclusive
are mirrored instead from sub , beginning at offset 0. |
CharSequence |
subSequence(int start,
int end)
Returns a
CharSequence from the start index (inclusive)
to the end index (exclusive) of this sequence. |
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
public static AlteredCharSequence make(CharSequence source, char[] sub, int substart, int subend)
source
, except that the range of
offsets substart
inclusive to subend
exclusive
are mirrored instead from sub
, beginning at offset 0.public char charAt(int off)
CharSequence
charAt
in interface CharSequence
off
- the index of the character to return.public int length()
CharSequence
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
CharSequence
CharSequence
from the start
index (inclusive)
to the end
index (exclusive) of this sequence.subSequence
in interface CharSequence
start
- the start offset of the sub-sequence. It is inclusive, that
is, the index of the first character that is included in the
sub-sequence.end
- the end offset of the sub-sequence. It is exclusive, that is,
the index of the first character after those that are included
in the sub-sequencepublic void getChars(int start, int end, char[] dest, int off)
GetChars
start
through end - 1
from this CharSequence into dest
beginning at offset destoff
.public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
toString
in interface CharSequence
toString
in class Object