aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/NgramContext.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-10-22 14:04:07 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-10-23 09:58:42 +0900
commitd3a4c5132422b189c8dbb94dbbe84a9b9761b0a8 (patch)
tree0f2e5b9e4dfb35bc1794033621943ec1fe607f52 /java/src/com/android/inputmethod/latin/NgramContext.java
parent924b8fd0fa456a084358ce916ac2b637b915946e (diff)
downloadlatinime-d3a4c5132422b189c8dbb94dbbe84a9b9761b0a8.tar.gz
latinime-d3a4c5132422b189c8dbb94dbbe84a9b9761b0a8.tar.xz
latinime-d3a4c5132422b189c8dbb94dbbe84a9b9761b0a8.zip
Fix Javadoc and null analysis related warnings
This CL also adds @SuppressWarning("unused" to java-overridable package. Bug: 18003991 Change-Id: If70527e30654384705d7a814f5efd181d9f539e1
Diffstat (limited to 'java/src/com/android/inputmethod/latin/NgramContext.java')
-rw-r--r--java/src/com/android/inputmethod/latin/NgramContext.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/NgramContext.java b/java/src/com/android/inputmethod/latin/NgramContext.java
index 2dc409f9f..4a3ac0fae 100644
--- a/java/src/com/android/inputmethod/latin/NgramContext.java
+++ b/java/src/com/android/inputmethod/latin/NgramContext.java
@@ -23,13 +23,17 @@ import com.android.inputmethod.latin.utils.StringUtils;
import java.util.Arrays;
+import javax.annotation.Nonnull;
+
/**
* Class to represent information of previous words. This class is used to add n-gram entries
* into binary dictionaries, to get predictions, and to get suggestions.
*/
public class NgramContext {
+ @Nonnull
public static final NgramContext EMPTY_PREV_WORDS_INFO =
new NgramContext(WordInfo.EMPTY_WORD_INFO);
+ @Nonnull
public static final NgramContext BEGINNING_OF_SENTENCE =
new NgramContext(WordInfo.BEGINNING_OF_SENTENCE_WORD_INFO);
@@ -37,7 +41,9 @@ public class NgramContext {
* Word information used to represent previous words information.
*/
public static class WordInfo {
+ @Nonnull
public static final WordInfo EMPTY_WORD_INFO = new WordInfo(null);
+ @Nonnull
public static final WordInfo BEGINNING_OF_SENTENCE_WORD_INFO = new WordInfo();
// This is an empty char sequence when mIsBeginningOfSentence is true.
@@ -97,6 +103,7 @@ public class NgramContext {
}
// Create next prevWordsInfo using current prevWordsInfo.
+ @Nonnull
public NgramContext getNextNgramContext(final WordInfo wordInfo) {
final int nextPrevWordCount = Math.min(Constants.MAX_PREV_WORD_COUNT_FOR_N_GRAM,
mPrevWordsCount + 1);