From 87eb7ac29c51ba4c341cb663cdbbc5ea74595f2d Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Wed, 1 Apr 2015 19:18:52 -0700 Subject: 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 --- .../android/inputmethod/latin/common/CollectionUtils.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'common/src') 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(); + } } -- cgit v1.2.3-83-g751a