diff options
author | 2015-04-01 19:18:52 -0700 | |
---|---|---|
committer | 2015-04-02 11:15:27 -0700 | |
commit | 87eb7ac29c51ba4c341cb663cdbbc5ea74595f2d (patch) | |
tree | 694894ec228c941fb203a8394b6b50867907188a /common/src/com | |
parent | 1a58c47ebe137ee1d5b3a2567b97802946945d38 (diff) | |
download | latinime-87eb7ac29c51ba4c341cb663cdbbc5ea74595f2d.tar.gz latinime-87eb7ac29c51ba4c341cb663cdbbc5ea74595f2d.tar.xz latinime-87eb7ac29c51ba4c341cb663cdbbc5ea74595f2d.zip |
Add shortcut support to UserDictionaryLookup.
Also move the class to the parent package, since it's no longer tied to the
spell checking service.
Bug 19966848.
Bug 20036810.
Change-Id: I35014d212fd87281eb90def03ee92e6872dcd63e
Diffstat (limited to 'common/src/com')
-rw-r--r-- | common/src/com/android/inputmethod/latin/common/CollectionUtils.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/common/src/com/android/inputmethod/latin/common/CollectionUtils.java b/common/src/com/android/inputmethod/latin/common/CollectionUtils.java index 48df413fd..80fae5f51 100644 --- a/common/src/com/android/inputmethod/latin/common/CollectionUtils.java +++ b/common/src/com/android/inputmethod/latin/common/CollectionUtils.java @@ -20,6 +20,7 @@ import com.android.inputmethod.annotations.UsedForTesting; import java.util.ArrayList; import java.util.Collection; +import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -60,7 +61,17 @@ public final class CollectionUtils { * @return Whether c contains no elements. */ @UsedForTesting - public static boolean isNullOrEmpty(@Nullable final Collection<?> c) { + public static boolean isNullOrEmpty(@Nullable final Collection c) { return c == null || c.isEmpty(); } + + /** + * Tests whether map contains no elements, true if map is null or map is empty. + * @param map Map to test. + * @return Whether map contains no elements. + */ + @UsedForTesting + public static boolean isNullOrEmpty(@Nullable final Map map) { + return map == null || map.isEmpty(); + } } |