CharSequence
public
interface
CharSequence
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 UTF-16 chars.
|
| StringBuffer |
A modifiable sequence of characters for use in creating
strings, where all accesses are synchronized.
|
| StringBuilder |
A modifiable sequence of characters for use in creating
strings.
|
|
This interface represents an ordered set of characters and defines the
methods to probe them.
Summary
Public methods |
abstract
char
|
charAt(int index)
Returns the character at index.
|
abstract
int
|
length()
Returns the number of characters in this sequence.
|
abstract
CharSequence
|
subSequence(int start, int end)
Returns a CharSequence from the start index (inclusive)
to the end index (exclusive) of this sequence.
|
abstract
String
|
toString()
Returns a string with the same characters in the same order as in this
sequence.
|
Public methods
charAt
char charAt (int index)
Returns the character at index.
length
int length ()
Returns the number of characters in this sequence.
| Returns |
int |
the number of characters.
|
subSequence
CharSequence subSequence (int start,
int end)
Returns a CharSequence from the start index (inclusive)
to the end index (exclusive) of this sequence.
| Parameters |
start |
int:
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 |
int:
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-sequence |
| Throws |
IndexOutOfBoundsException |
if start < 0, end < 0, start > end,
or if start or end are greater than the
length of this sequence.
|
toString
String toString ()
Returns a string with the same characters in the same order as in this
sequence.
| Returns |
String |
a string based on this sequence.
|