Build 1.0_r1(from source)

android.text
Class AlteredCharSequence

java.lang.Object
  extended by android.text.AlteredCharSequence
All Implemented Interfaces:
GetChars, CharSequence

public class AlteredCharSequence
extends Object
implements CharSequence, GetChars

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.


Method Summary
 char charAt(int off)
          Returns the character at the specified index, with the first character having index zero.
 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 the 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 the receiver.
(package private)  void update(char[] sub, int substart, int subend)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public 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.


update

void update(char[] sub,
            int substart,
            int subend)

charAt

public char charAt(int off)
Description copied from interface: CharSequence
Returns the character at the specified index, with the first character having index zero.

Specified by:
charAt in interface CharSequence
Parameters:
off - The index of the character to return
Returns:
The requested character

length

public int length()
Description copied from interface: CharSequence
Returns the number of characters in the sequence.

Specified by:
length in interface CharSequence
Returns:
the number of characters in the sequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Description copied from interface: CharSequence
Returns a CharSequence from the start index (inclusive) to the end index (exclusive) of this sequence.

Specified by:
subSequence in interface CharSequence
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

getChars

public void getChars(int start,
                     int end,
                     char[] dest,
                     int off)
Description copied from interface: GetChars
Exactly like String.getChars(): copy chars start through end - 1 from this CharSequence into dest beginning at offset destoff.

Specified by:
getChars in interface GetChars

toString

public String toString()
Description copied from class: Object
Returns a string containing a concise, human-readable description of the receiver.

Specified by:
toString in interface CharSequence
Overrides:
toString in class Object
Returns:
String a printable representation for the receiver.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature