FileDocCategorySizeDatePackage
Editable.javaAPI DocAndroid 1.5 API5026Wed May 06 22:41:56 BST 2009android.text

Editable

public interface Editable implements Appendable, CharSequence, GetChars, Spannable
This is the interface for text whose content and markup can be changed (as opposed to immutable text like Strings). If you make a {@link DynamicLayout} of an Editable, the layout will be reflowed as the text is changed.

Fields Summary
Constructors Summary
Methods Summary
public android.text.Editableappend(java.lang.CharSequence text)
Convenience for replace(length(), length(), text, 0, text.length())

see
#replace(int, int, CharSequence, int, int)

public android.text.Editableappend(java.lang.CharSequence text, int start, int end)
Convenience for replace(length(), length(), text, start, end)

see
#replace(int, int, CharSequence, int, int)

public android.text.Editableappend(char text)
Convenience for append(String.valueOf(text)).

see
#replace(int, int, CharSequence, int, int)

public voidclear()
Convenience for replace(0, length(), "", 0, 0)

see
#replace(int, int, CharSequence, int, int) Note that this clears the text, not the spans; use {@link #clearSpans} if you need that.

public voidclearSpans()
Removes all spans from the Editable, as if by calling {@link #removeSpan} on each of them.

public android.text.Editabledelete(int st, int en)
Convenience for replace(st, en, "", 0, 0)

see
#replace(int, int, CharSequence, int, int)

public InputFilter[]getFilters()
Returns the array of input filters that are currently applied to changes to this Editable.

public android.text.Editableinsert(int where, java.lang.CharSequence text, int start, int end)
Convenience for replace(where, where, text, start, end)

see
#replace(int, int, CharSequence, int, int)

public android.text.Editableinsert(int where, java.lang.CharSequence text)
Convenience for replace(where, where, text, 0, text.length());

see
#replace(int, int, CharSequence, int, int)

public android.text.Editablereplace(int st, int en, java.lang.CharSequence source, int start, int end)
Replaces the specified range (st…en) of text in this Editable with a copy of the slice start…end from source. The destination slice may be empty, in which case the operation is an insertion, or the source slice may be empty, in which case the operation is a deletion.

Before the change is committed, each filter that was set with {@link #setFilters} is given the opportunity to modify the source text.

If source is Spanned, the spans from it are preserved into the Editable. Existing spans within the Editable that entirely cover the replaced range are retained, but any that were strictly within the range that was replaced are removed. As a special case, the cursor position is preserved even when the entire range where it is located is replaced.

return
a reference to this object.

public android.text.Editablereplace(int st, int en, java.lang.CharSequence text)
Convenience for replace(st, en, text, 0, text.length())

see
#replace(int, int, CharSequence, int, int)

public voidsetFilters(InputFilter[] filters)
Sets the series of filters that will be called in succession whenever the text of this Editable is changed, each of which has the opportunity to limit or transform the text that is being inserted.