Merge "Move up the static methods of the Builder"

main
Jean Chalard 2012-03-13 21:22:22 -07:00 committed by Android (Google) Code Review
commit d42b0238f9
3 changed files with 42 additions and 42 deletions

View File

@ -924,7 +924,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
final List<SuggestedWords.SuggestedWordInfo> applicationSuggestedWords =
SuggestedWords.Builder.getFromApplicationSpecifiedCompletions(
SuggestedWords.getFromApplicationSpecifiedCompletions(
applicationSpecifiedCompletions);
SuggestedWords.Builder builder = new SuggestedWords.Builder(applicationSuggestedWords,
false /* typedWordValid */,
@ -1788,7 +1788,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
previousSuggestions = SuggestedWords.EMPTY;
}
final ArrayList<SuggestedWords.SuggestedWordInfo> typedWordAndPreviousSuggestions =
SuggestedWords.Builder.getTypedWordAndPreviousSuggestions(
SuggestedWords.getTypedWordAndPreviousSuggestions(
typedWord, previousSuggestions);
final SuggestedWords.Builder obsoleteSuggestionsBuilder =
new SuggestedWords.Builder(typedWordAndPreviousSuggestions,

View File

@ -270,7 +270,7 @@ public class Suggest implements Dictionary.WordCallback {
StringUtils.removeDupes(mSuggestions);
return new SuggestedWords.Builder(
SuggestedWords.Builder.getFromCharSequenceList(mSuggestions),
SuggestedWords.getFromCharSequenceList(mSuggestions),
false /* typedWordValid */,
false /* hasMinimalSuggestion */,
false /* allowsToBeAutoCorrected */,
@ -428,7 +428,7 @@ public class Suggest implements Dictionary.WordCallback {
"--", false));
}
} else {
scoreInfoList = SuggestedWords.Builder.getFromCharSequenceList(mSuggestions);
scoreInfoList = SuggestedWords.getFromCharSequenceList(mSuggestions);
}
boolean autoCorrectionAvailable = hasAutoCorrection;

View File

@ -98,6 +98,13 @@ public class SuggestedWords {
mShouldBlockAutoCorrectionBySafetyNet = shouldBlockAutoCorrectionBySafetyNet;
}
public SuggestedWords build() {
return new SuggestedWords(mTypedWordValid, mHasMinimalSuggestion,
mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet,
mAllowsToBeAutoCorrected, mSuggestedWordInfoList);
}
}
public static ArrayList<SuggestedWordInfo> getFromCharSequenceList(
final List<CharSequence> wordList) {
final ArrayList<SuggestedWordInfo> result = new ArrayList<SuggestedWordInfo>();
@ -136,13 +143,6 @@ public class SuggestedWords {
return suggestionsList;
}
public SuggestedWords build() {
return new SuggestedWords(mTypedWordValid, mHasMinimalSuggestion,
mIsPunctuationSuggestions, mShouldBlockAutoCorrectionBySafetyNet,
mAllowsToBeAutoCorrected, mSuggestedWordInfoList);
}
}
public static class SuggestedWordInfo {
public final CharSequence mWord;
private final CharSequence mDebugString;