Android
android.text
public class

android.text.SpannableString

java.lang.Object
android.text.SpannableString GetChars Spannable CharSequence

This is the class for text whose content is immutable but to which markup objects can be attached and detached. For mutable text, see SpannableStringBuilder.

Summary

Constants inherited from interface android.text.Spanned

Public Constructors

            SpannableString(CharSequence source)

Public Methods

    final      char  charAt(int i)
Returns the character at the specified index, with the first character having index zero.
    final      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  getSpanEnd(Object what)
Return the end of the range of text to which the specified markup object is attached, or -1 if the object is not attached.
          int  getSpanFlags(Object what)
Return the flags that were specified when setSpan(Object, int, int, int) was used to attach the specified markup object, or 0 if the specified object has not been attached.
          int  getSpanStart(Object what)
Return the beginning of the range of text to which the specified markup object is attached, or -1 if the object is not attached.
        <T>  T[]  getSpans(int queryStart, int queryEnd, Class<T> kind)
Return an array of the markup objects attached to the specified slice of this CharSequence and whose type is the specified type or a subclass of it.
    final      int  length()
Returns the number of characters in the sequence.
          int  nextSpanTransition(int start, int limit, Class kind)
Return the first offset greater than or equal to start where a markup object of class type begins or ends, or limit if there are no starts or ends greater than or equal to start but less than limit.
          void  removeSpan(Object what)
          void  setSpan(Object what, int start, int end, int flags)
    final      CharSequence  subSequence(int start, int end)
Returns a CharSequence from the start index (inclusive) to the end index (exclusive) of this sequence.
    final      String  toString()
Returns a string containing a concise, human-readable description of the receiver.
      static    SpannableString  valueOf(CharSequence source)
Methods inherited from class java.lang.Object
Methods inherited from interface android.text.GetChars
Methods inherited from interface android.text.Spannable
Methods inherited from interface android.text.Spanned
Methods inherited from interface java.lang.CharSequence

Details

Public Constructors

public SpannableString(CharSequence source)

Public Methods

public final char charAt(int i)

Returns the character at the specified index, with the first character having index zero.

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

public int getSpanEnd(Object what)

Return the end of the range of text to which the specified markup object is attached, or -1 if the object is not attached.

public int getSpanFlags(Object what)

Return the flags that were specified when setSpan(Object, int, int, int) was used to attach the specified markup object, or 0 if the specified object has not been attached.

public int getSpanStart(Object what)

Return the beginning of the range of text to which the specified markup object is attached, or -1 if the object is not attached.

public T[] getSpans(int queryStart, int queryEnd, Class<T> kind)

Return an array of the markup objects attached to the specified slice of this CharSequence and whose type is the specified type or a subclass of it. Specify Object.class for the type if you want all the objects regardless of type.

public final int length()

Returns the number of characters in the sequence.

public int nextSpanTransition(int start, int limit, Class kind)

Return the first offset greater than or equal to start where a markup object of class type begins or ends, or limit if there are no starts or ends greater than or equal to start but less than limit. Specify null or Object.class for the type if you want every transition regardless of type.

public void removeSpan(Object what)

public void setSpan(Object what, int start, int end, int flags)

public final CharSequence subSequence(int start, int end)

Returns a CharSequence from the start index (inclusive) to the end index (exclusive) of this sequence.

public final String toString()

Returns a string containing a concise, human-readable description of the receiver.

Returns

  • String a printable representation for the receiver.

public static SpannableString valueOf(CharSequence source)

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48