public class AlteredCharSequence extends Object implements CharSequence, GetChars
Modifier and Type | Method and Description |
---|---|
char |
charAt(int off)
Returns the
char value at the specified index. |
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 length of this character 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 new
CharSequence that is a subsequence of this sequence. |
String |
toString()
Returns a string representation of the object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
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
char
value at the specified index. An index ranges from zero
to length() - 1. The first char
value of the sequence is at
index zero, the next at index one, and so on, as for array
indexing.
If the char
value specified by the index is a
surrogate, the surrogate
value is returned.
charAt
in interface CharSequence
off
- the index of the char
value to be returnedchar
valuepublic int length()
CharSequence
char
s in the sequence.length
in interface CharSequence
char
s in this sequencepublic CharSequence subSequence(int start, int end)
CharSequence
CharSequence
that is a subsequence of this sequence.
The subsequence starts with the char
value at the specified index and
ends with the char
value at index end - 1. The length
(in char
s) of the
returned sequence is end - start, so if start == end
then an empty sequence is returned. subSequence
in interface CharSequence
start
- the start index, inclusiveend
- the end index, exclusivepublic 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
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in interface CharSequence
toString
in class Object