diff options
Diffstat (limited to 'core/java/android/util/SparseArrayMap.java')
| -rw-r--r-- | core/java/android/util/SparseArrayMap.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/util/SparseArrayMap.java b/core/java/android/util/SparseArrayMap.java index cd592a710a02..e5bb9f453a88 100644 --- a/core/java/android/util/SparseArrayMap.java +++ b/core/java/android/util/SparseArrayMap.java @@ -62,6 +62,14 @@ public class SparseArrayMap<K, V> { } /** + * Removes all the data for the keyIndex, if there was any. + * @hide + */ + public void deleteAt(int keyIndex) { + mData.removeAt(keyIndex); + } + + /** * Removes the data for the key and mapKey, if there was any. * * @return Returns the value that was stored under the keys, or null if there was none. @@ -142,6 +150,15 @@ public class SparseArrayMap<K, V> { return data == null ? 0 : data.size(); } + /** + * Returns the number of elements in the map of the given keyIndex. + * @hide + */ + public int numElementsForKeyAt(int keyIndex) { + ArrayMap<K, V> data = mData.valueAt(keyIndex); + return data == null ? 0 : data.size(); + } + /** Returns the value V at the given key and map index. */ @Nullable public V valueAt(int keyIndex, int mapIndex) { |
