FileDocCategorySizeDatePackage
CorrectionInfo.javaAPI DocAndroid 5.1 API3282Thu Mar 12 22:22:10 GMT 2015android.view.inputmethod

CorrectionInfo

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

Fields Summary
private final int
mOffset
private final CharSequence
mOldText
private final CharSequence
mNewText
public static final Parcelable.Creator
CREATOR
Used to make this class parcelable.
Constructors Summary
public CorrectionInfo(int offset, CharSequence oldText, CharSequence newText)

param
offset The offset in the edited text where the old and new text start.
param
oldText The old text that has been replaced.
param
newText The replacement text.

        mOffset = offset;
        mOldText = oldText;
        mNewText = newText;
    
private CorrectionInfo(android.os.Parcel source)

        mOffset = source.readInt();
        mOldText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
        mNewText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
    
Methods Summary
public intdescribeContents()


       
        return 0;
    
public java.lang.CharSequencegetNewText()
Return the new text that corrects what was typed by the user.

        return mNewText;
    
public intgetOffset()
Return the offset position of this correction in the text. Both the {@link #getOldText()} and {@link #getNewText()} start at this offset.

        return mOffset;
    
public java.lang.CharSequencegetOldText()
Return the text that has actually been typed by the user, and which has been corrected.

        return mOldText;
    
public java.lang.StringtoString()

        return "CorrectionInfo{#" + mOffset + " \"" + mOldText + "\" -> \"" + mNewText + "\"}";
    
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.writeInt(mOffset);
        TextUtils.writeToParcel(mOldText, dest, flags);
        TextUtils.writeToParcel(mNewText, dest, flags);