Build 1.0_r1(from source)

android.text
Class SpannableString

java.lang.Object
  extended by android.text.SpannableStringInternal
      extended by android.text.SpannableString
All Implemented Interfaces:
GetChars, Spannable, Spanned, CharSequence

public class SpannableString
extends SpannableStringInternal
implements CharSequence, GetChars, Spannable

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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.text.Spannable
Spannable.Factory
 
Field Summary
 
Fields inherited from class android.text.SpannableStringInternal
EMPTY
 
Fields inherited from interface android.text.Spanned
SPAN_EXCLUSIVE_EXCLUSIVE, SPAN_EXCLUSIVE_INCLUSIVE, SPAN_INCLUSIVE_EXCLUSIVE, SPAN_INCLUSIVE_INCLUSIVE, SPAN_MARK_MARK, SPAN_MARK_POINT, SPAN_PARAGRAPH, SPAN_POINT_MARK, SPAN_POINT_POINT, SPAN_PRIORITY, SPAN_PRIORITY_SHIFT, SPAN_USER, SPAN_USER_SHIFT
 
Constructor Summary
SpannableString(CharSequence source)
           
 
Method Summary
 void removeSpan(Object what)
          Remove the specified object from the range of text to which it was attached, if any.
 void setSpan(Object what, int start, int end, int flags)
          Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere.
 CharSequence subSequence(int start, int end)
          Returns a CharSequence from the start index (inclusive) to the end index (exclusive) of this sequence.
static SpannableString valueOf(CharSequence source)
           
 
Methods inherited from class android.text.SpannableStringInternal
charAt, getChars, getSpanEnd, getSpanFlags, getSpans, getSpanStart, length, nextSpanTransition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface android.text.GetChars
getChars
 
Methods inherited from interface android.text.Spanned
getSpanEnd, getSpanFlags, getSpans, getSpanStart, nextSpanTransition
 
Methods inherited from interface java.lang.CharSequence
charAt, length, toString
 

Constructor Detail

SpannableString

public SpannableString(CharSequence source)
Method Detail

valueOf

public static SpannableString valueOf(CharSequence source)

setSpan

public void setSpan(Object what,
                    int start,
                    int end,
                    int flags)
Description copied from interface: Spannable
Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere. See Spanned for an explanation of what the flags mean. The object can be one that has meaning only within your application, or it can be one that the text system will use to affect text display or behavior. Some noteworthy ones are the subclasses of CharacterStyle and ParagraphStyle, and TextWatcher and SpanWatcher.

Specified by:
setSpan in interface Spannable
Overrides:
setSpan in class SpannableStringInternal

removeSpan

public void removeSpan(Object what)
Description copied from interface: Spannable
Remove the specified object from the range of text to which it was attached, if any. It is OK to remove an object that was never attached in the first place.

Specified by:
removeSpan in interface Spannable
Overrides:
removeSpan in class SpannableStringInternal

subSequence

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

Build 1.0_r1(from source)

Please submit a feedback, bug or feature