diff options
author | 2012-09-27 18:16:16 +0900 | |
---|---|---|
committer | 2012-09-27 19:03:30 +0900 | |
commit | a28a05e971cc242b338331a3b78276fa95188d19 (patch) | |
tree | 946755db07ee5808be32ae16424dee6dac4abdad /java/src/com/android/inputmethod/latin/spellcheck | |
parent | 17752016713b92a55e9c2356d07b7ed51c67416b (diff) | |
download | latinime-a28a05e971cc242b338331a3b78276fa95188d19.tar.gz latinime-a28a05e971cc242b338331a3b78276fa95188d19.tar.xz latinime-a28a05e971cc242b338331a3b78276fa95188d19.zip |
Cleanup: Make some classes as final
Change-Id: I6009b3c1950ba32b7f1e205a3db2307fe0cd688e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck')
8 files changed, 13 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java index eef7a51f2..5a11ae534 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java @@ -50,7 +50,7 @@ import java.util.TreeMap; /** * Service for spell checking, using LatinIME's dictionaries and mechanisms. */ -public class AndroidSpellCheckerService extends SpellCheckerService +public final class AndroidSpellCheckerService extends SpellCheckerService implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = AndroidSpellCheckerService.class.getSimpleName(); private static final boolean DBG = false; @@ -201,8 +201,8 @@ public class AndroidSpellCheckerService extends SpellCheckerService } // TODO: remove this class and replace it by storage local to the session. - public static class SuggestionsGatherer { - public static class Result { + public static final class SuggestionsGatherer { + public static final class Result { public final String[] mSuggestions; public final boolean mHasRecommendedSuggestions; public Result(final String[] gatheredSuggestions, diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java index 5a1bd37f5..668e7a641 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java @@ -26,7 +26,7 @@ import com.android.inputmethod.latin.CollectionUtils; import java.util.ArrayList; -public class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheckerSession { +public final class AndroidSpellCheckerSession extends AndroidWordLevelSpellCheckerSession { private static final String TAG = AndroidSpellCheckerSession.class.getSimpleName(); private static final boolean DBG = false; private final static String[] EMPTY_STRING_ARRAY = new String[0]; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java index d9b622a18..53ed4d3c3 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java @@ -50,7 +50,7 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session { protected final SuggestionsCache mSuggestionsCache = new SuggestionsCache(); private final ContentObserver mObserver; - private static class SuggestionsParams { + private static final class SuggestionsParams { public final String[] mSuggestions; public final int mFlags; public SuggestionsParams(String[] suggestions, int flags) { @@ -59,7 +59,7 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session { } } - protected static class SuggestionsCache { + protected static final class SuggestionsCache { private static final char CHAR_DELIMITER = '\uFFFC'; private static final int MAX_CACHE_SIZE = 50; private final LruCache<String, SuggestionsParams> mUnigramSuggestionsInfoCache = diff --git a/java/src/com/android/inputmethod/latin/spellcheck/DictAndProximity.java b/java/src/com/android/inputmethod/latin/spellcheck/DictAndProximity.java index 3dbbd40cd..9d7c61a33 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/DictAndProximity.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/DictAndProximity.java @@ -22,7 +22,7 @@ import com.android.inputmethod.keyboard.ProximityInfo; /** * A simple container for both a Dictionary and a ProximityInfo. */ -public class DictAndProximity { +public final class DictAndProximity { public final Dictionary mDictionary; public final ProximityInfo mProximityInfo; public DictAndProximity(final Dictionary dictionary, final ProximityInfo proximityInfo) { diff --git a/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java b/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java index 53aa6c719..1fb2bbb6a 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; * the client code, but may help with sloppy clients. */ @SuppressWarnings("serial") -public class DictionaryPool extends LinkedBlockingQueue<DictAndProximity> { +public final class DictionaryPool extends LinkedBlockingQueue<DictAndProximity> { private final static String TAG = DictionaryPool.class.getSimpleName(); // How many seconds we wait for a dictionary to become available. Past this delay, we give up in // fear some bug caused a deadlock, and reset the whole pool. diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java index fe5225ebd..11bb97031 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java @@ -22,7 +22,7 @@ import com.android.inputmethod.latin.Constants; import java.util.TreeMap; -public class SpellCheckerProximityInfo { +public final class SpellCheckerProximityInfo { /* public for test */ final public static int NUL = Constants.NOT_A_CODE; @@ -53,7 +53,7 @@ public class SpellCheckerProximityInfo { return result; } - private static class Latin { + private static final class Latin { // This is a map from the code point to the index in the PROXIMITY array. // At the time the native code to read the binary dictionary needs the proximity info be // passed as a flat array spaced by MAX_PROXIMITY_CHARS_SIZE columns, one for each input @@ -122,7 +122,7 @@ public class SpellCheckerProximityInfo { } } - private static class Cyrillic { + private static final class Cyrillic { final private static TreeMap<Integer, Integer> INDICES = CollectionUtils.newTreeMap(); // TODO: The following table is solely based on the keyboard layout. Consult with Russian // speakers on commonly misspelled words/letters. diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java index e14db8797..e63dff312 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsActivity.java @@ -23,7 +23,7 @@ import android.preference.PreferenceActivity; /** * Spell checker preference screen. */ -public class SpellCheckerSettingsActivity extends PreferenceActivity { +public final class SpellCheckerSettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java index 7056874a1..ef5123d68 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java @@ -24,7 +24,7 @@ import com.android.inputmethod.latin.R; /** * Preference screen. */ -public class SpellCheckerSettingsFragment extends PreferenceFragment { +public final class SpellCheckerSettingsFragment extends PreferenceFragment { /** * Empty constructor for fragment generation. */ |