java.lang
public
interface
java.lang.CharSequence
The CharSequence interface represents an ordered set of characters and the
functions to probe them.
Known Indirect Subclasses
AlteredCharSequence,
CharBuffer,
Editable,
GetChars,
Spannable,
SpannableString,
SpannableStringBuilder,
Spanned,
SpannedString,
String,
StringBuffer,
StringBuilder
| AlteredCharSequence |
An AlteredCharSequence is a CharSequence that is largely mirrored from
another CharSequence, except that a specified range of characters are
mirrored from a different char array instead. |
| CharBuffer |
A buffer of chars. |
| Editable |
This is the interface for text whose content and markup
can be changed (as opposed
to immutable text like Strings). |
| GetChars |
Please implement this interface if your CharSequence has a
getChars() method like the one in String that is faster than
calling charAt() multiple times. |
| Spannable |
This is the interface for text to which markup objects can be
attached and detached. |
| SpannableString |
This is the class for text whose content is immutable but to which
markup objects can be attached and detached. |
| SpannableStringBuilder |
This is the class for text whose content and markup can both be changed. |
| Spanned |
This is the interface for text that has markup objects attached to
ranges of it. |
| SpannedString |
This is the class for text whose content and markup are immutable. |
| String |
An immutable sequence of characters/code units (chars). |
| StringBuffer |
StringBuffer is a variable size contiguous indexable array of characters. |
| StringBuilder |
A modifiable sequence of characters for use in creating
and modifying Strings. |
Summary
Details
Public Methods
public
char
charAt(int index)
Answers the character at the specified index (0-based indexing).
Parameters
| index
| -
of the character to return |
Returns
- character indicated by index
public
int
length()
Answers the number of characters in the sequence.
Returns
- the number of charcters in the sequence
public
CharSequence
subSequence(int start, int end)
Answers a CharSequence from the
start index to the
end index of this sequence.
Parameters
| start
| -- index of the start of the sub-sequence to return |
| end
| -- index of the end of the sub-sequence to return |
Returns
- the sub sequence from start to end
public
String
toString()
Answers a String with the same characters and ordering of this
CharSequence
Returns
- a String based on the CharSequence