Build 1.0_r1(from source)

java.lang
Interface CharSequence

All Known Subinterfaces:
Editable, GetChars, GraphicsOperations, Spannable, Spanned
All Known Implementing Classes:
AlteredCharSequence, CharArrayBuffer, CharBuffer, CharSequenceAdapter, CharToByteBufferAdapter, Layout.Ellipsizer, Layout.SpannedEllipsizer, ReadOnlyCharArrayBuffer, ReadWriteCharArrayBuffer, SpannableString, SpannableStringBuilder, SpannedString, String, StringBuffer, StringBuilder

public interface CharSequence

The CharSequence interface represents an ordered set of characters and the functions to probe them.


Method Summary
 char charAt(int index)
          Returns the character at the specified index, with the first character having index zero.
 int length()
          Returns the number of characters in the sequence.
 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 with the same characters and ordering of this CharSequence
 

Method Detail

length

int length()
Returns the number of characters in the sequence.

Returns:
the number of characters in the sequence

charAt

char charAt(int index)
Returns the character at the specified index, with the first character having index zero.

Parameters:
index - The index of the character to return
Returns:
The requested character
Throws:
IndexOutOfBoundsException - when index < 0 or index >= the length of the CharSequence

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 - The starting offset of the sub-sequence, that is, the index of the first character that goes into the sub-sequence
end - The ending offset of the sub-sequence, that is, the index of the first character after those that go into the sub-sequence
Returns:
The requested sub-sequence
Throws:
IndexOutOfBoundsException - when 1. either index is below 0 2. either index >= this.length() 3. start > end

toString

String toString()
Returns a String with the same characters and ordering of this CharSequence

Overrides:
toString in class Object
Returns:
a String based on the CharSequence

Build 1.0_r1(from source)

Please submit a feedback, bug or feature