FileDocCategorySizeDatePackage
CompletionInfo.javaAPI DocAndroid 1.5 API3885Wed May 06 22:41:56 BST 2009android.view.inputmethod

CompletionInfo

public final class CompletionInfo extends Object implements android.os.Parcelable
Information about a single text completion that an editor has reported to an input method.

Fields Summary
static final String
TAG
final long
mId
final int
mPosition
final CharSequence
mText
final CharSequence
mLabel
public static final Parcelable.Creator
CREATOR
Used to make this class parcelable.
Constructors Summary
public CompletionInfo(long id, int index, CharSequence text)
Create a simple completion with just text, no label.

    
                  
           
        mId = id;
        mPosition = index;
        mText = text;
        mLabel = null;
    
public CompletionInfo(long id, int index, CharSequence text, CharSequence label)
Create a full completion with both text and label.

        mId = id;
        mPosition = index;
        mText = text;
        mLabel = label;
    
CompletionInfo(android.os.Parcel source)

        mId = source.readLong();
        mPosition = source.readInt();
        mText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
        mLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
    
Methods Summary
public intdescribeContents()


       
        return 0;
    
public longgetId()
Return the abstract identifier for this completion, typically corresponding to the id associated with it in the original adapter.

        return mId;
    
public java.lang.CharSequencegetLabel()
Return the user-visible label for the completion, or null if the plain text should be shown. If non-null, this will be what the user sees as the completion option instead of the actual text.

        return mLabel;
    
public intgetPosition()
Return the original position of this completion, typically corresponding to its position in the original adapter.

        return mPosition;
    
public java.lang.CharSequencegetText()
Return the actual text associated with this completion. This is the real text that will be inserted into the editor if the user selects it.

        return mText;
    
public java.lang.StringtoString()

        return "CompletionInfo{#" + mPosition + " \"" + mText
                + "\" id=" + mId + " label=" + mLabel + "}";
    
public voidwriteToParcel(android.os.Parcel dest, int flags)
Used to package this object into a {@link Parcel}.

param
dest The {@link Parcel} to be written.
param
flags The flags used for parceling.

        dest.writeLong(mId);
        dest.writeInt(mPosition);
        TextUtils.writeToParcel(mText, dest, flags);
        TextUtils.writeToParcel(mLabel, dest, flags);