From 3187ba5dfe4bd3c781bae01233314cbcd6e64dc5 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 15 Mar 2012 14:21:02 +0900 Subject: Remove a now-useless flag. This has been moved to the SuggestedWords object and is now represented by a single flag instead of a flag in each suggestion. Change-Id: I6e9a7cff5a7701de7e61b4de13baac25c9a87b1b --- java/src/com/android/inputmethod/latin/Suggest.java | 7 +++---- .../com/android/inputmethod/latin/SuggestedWords.java | 18 +++++------------- 2 files changed, 8 insertions(+), 17 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 79a819d1e..69754d769 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -429,7 +429,7 @@ public class Suggest implements Dictionary.WordCallback { final int suggestionsSize = suggestions.size(); final ArrayList suggestionsList = new ArrayList(suggestionsSize); - suggestionsList.add(new SuggestedWordInfo(autoCorrectionSuggestion, "+", false)); + suggestionsList.add(new SuggestedWordInfo(autoCorrectionSuggestion, "+")); // Note: i here is the index in mScores[], but the index in mSuggestions is one more // than i because we added the typed word to mSuggestions without touching mScores. for (int i = 0; i < scores.length && i < suggestionsSize - 1; ++i) { @@ -440,11 +440,10 @@ public class Suggest implements Dictionary.WordCallback { } else { scoreInfoString = Integer.toString(scores[i]); } - suggestionsList.add(new SuggestedWordInfo(suggestions.get(i + 1), - scoreInfoString, false)); + suggestionsList.add(new SuggestedWordInfo(suggestions.get(i + 1), scoreInfoString)); } for (int i = scores.length; i < suggestionsSize; ++i) { - suggestionsList.add(new SuggestedWordInfo(suggestions.get(i), "--", false)); + suggestionsList.add(new SuggestedWordInfo(suggestions.get(i), "--")); } return suggestionsList; } diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 3c5e65f16..19967ef5e 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -85,7 +85,7 @@ public class SuggestedWords { final List wordList) { final ArrayList result = new ArrayList(); for (CharSequence word : wordList) { - if (null != word) result.add(new SuggestedWordInfo(word, null, false)); + if (null != word) result.add(new SuggestedWordInfo(word, null)); } return result; } @@ -94,7 +94,7 @@ public class SuggestedWords { final CompletionInfo[] infos) { final ArrayList result = new ArrayList(); for (CompletionInfo info : infos) { - if (null != info) result.add(new SuggestedWordInfo(info.getText(), null, false)); + if (null != info) result.add(new SuggestedWordInfo(info.getText(), null)); } return result; } @@ -105,14 +105,14 @@ public class SuggestedWords { final CharSequence typedWord, final SuggestedWords previousSuggestions) { final ArrayList suggestionsList = new ArrayList(); final HashSet alreadySeen = new HashSet(); - suggestionsList.add(new SuggestedWordInfo(typedWord, null, false)); + suggestionsList.add(new SuggestedWordInfo(typedWord, null)); alreadySeen.add(typedWord.toString()); final int previousSize = previousSuggestions.size(); for (int pos = 1; pos < previousSize; pos++) { final String prevWord = previousSuggestions.getWord(pos).toString(); // Filter out duplicate suggestion. if (!alreadySeen.contains(prevWord)) { - suggestionsList.add(new SuggestedWordInfo(prevWord, null, true)); + suggestionsList.add(new SuggestedWordInfo(prevWord, null)); alreadySeen.add(prevWord); } } @@ -122,19 +122,15 @@ public class SuggestedWords { public static class SuggestedWordInfo { public final CharSequence mWord; private final CharSequence mDebugString; - private final boolean mPreviousSuggestedWord; public SuggestedWordInfo(final CharSequence word) { mWord = word; mDebugString = ""; - mPreviousSuggestedWord = false; } - public SuggestedWordInfo(final CharSequence word, final CharSequence debugString, - final boolean previousSuggestedWord) { + public SuggestedWordInfo(final CharSequence word, final CharSequence debugString) { mWord = word; mDebugString = debugString; - mPreviousSuggestedWord = previousSuggestedWord; } public String getDebugString() { @@ -145,10 +141,6 @@ public class SuggestedWords { } } - public boolean isObsoleteSuggestedWord () { - return mPreviousSuggestedWord; - } - @Override public String toString() { if (TextUtils.isEmpty(mDebugString)) { -- cgit v1.2.3-83-g751a