Android APIs
public class

AlteredCharSequence

extends Object
implements CharSequence GetChars
java.lang.Object
   ↳ android.text.AlteredCharSequence

Class Overview

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.

Summary

Public Methods
char charAt(int off)
Returns the character at 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 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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.CharSequence
From interface android.text.GetChars

Public Methods

public char charAt (int off)

Added in API level 1

Returns the character at index.

Parameters
off int
Returns
char

public void getChars (int start, int end, char[] dest, int off)

Added in API level 1

Exactly like String.getChars(): copy chars start through end - 1 from this CharSequence into dest beginning at offset destoff.

Parameters
start int
end int
dest char
off int

public int length ()

Added in API level 1

Returns the number of characters in this sequence.

Returns
int the number of characters.

public static AlteredCharSequence make (CharSequence source, char[] sub, int substart, int subend)

Added in API level 1

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.

Parameters
source CharSequence
sub char
substart int
subend int
Returns
AlteredCharSequence

public CharSequence subSequence (int start, int end)

Added in API level 1

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
Returns
CharSequence the requested sub-sequence.

public String toString ()

Added in API level 1

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
String a printable representation of this object.