aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-05-30 23:47:54 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-05-31 18:14:47 +0900
commita0c3e02d7168dd4cee4cad51491537dadb0362cc (patch)
tree08ecd061e132471d2c1d0d2b7ff8b2f6c2b8bee6 /java/src/com/android/inputmethod/latin/SuggestedWords.java
parent70c2dcffa3fdce8040d0779dd173d5634e434cba (diff)
downloadlatinime-a0c3e02d7168dd4cee4cad51491537dadb0362cc.tar.gz
latinime-a0c3e02d7168dd4cee4cad51491537dadb0362cc.tar.xz
latinime-a0c3e02d7168dd4cee4cad51491537dadb0362cc.zip
Refactor SuggestionStripLayoutHelper a bit
Bug: 9059710 Change-Id: Ief12029bad75d4dc78090ab97555aece01b873de
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index 1f453273b..7a16595a7 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -24,6 +24,9 @@ import java.util.Arrays;
import java.util.HashSet;
public final class SuggestedWords {
+ public static final int INDEX_OF_TYPED_WORD = 0;
+ public static final int INDEX_OF_AUTO_CORRECTION = 1;
+
private static final ArrayList<SuggestedWordInfo> EMPTY_WORD_INFO_LIST =
CollectionUtils.newArrayList(0);
public static final SuggestedWords EMPTY = new SuggestedWords(
@@ -61,12 +64,12 @@ public final class SuggestedWords {
return mSuggestedWordInfoList.size();
}
- public String getWord(int pos) {
- return mSuggestedWordInfoList.get(pos).mWord;
+ public String getWord(final int index) {
+ return mSuggestedWordInfoList.get(index).mWord;
}
- public SuggestedWordInfo getInfo(int pos) {
- return mSuggestedWordInfoList.get(pos);
+ public SuggestedWordInfo getInfo(final int index) {
+ return mSuggestedWordInfoList.get(index);
}
public boolean willAutoCorrect() {
@@ -108,8 +111,8 @@ public final class SuggestedWords {
SuggestedWordInfo.KIND_TYPED, Dictionary.TYPE_USER_TYPED));
alreadySeen.add(typedWord.toString());
final int previousSize = previousSuggestions.size();
- for (int pos = 1; pos < previousSize; pos++) {
- final SuggestedWordInfo prevWordInfo = previousSuggestions.getInfo(pos);
+ for (int index = 1; index < previousSize; index++) {
+ final SuggestedWordInfo prevWordInfo = previousSuggestions.getInfo(index);
final String prevWord = prevWordInfo.mWord;
// Filter out duplicate suggestion.
if (!alreadySeen.contains(prevWord)) {