From 79cbc340b2064ad8b3f6c5ec498b51b1f64a33f1 Mon Sep 17 00:00:00 2001 From: Kweku Adams Date: Fri, 13 Dec 2019 18:03:49 -0800 Subject: Fix documentation in SparseSetArray. "n" in SparseSetArray is actually the key, not the index. "index" is used as a parameter name in this class wherever it actually is the index. Using index in documentation in the wrong places gives users the wrong understanding. Bug: N/A Test: N/A Change-Id: I239a653347dab4ea1a00c6d709aac06a98012a46 --- core/java/android/util/SparseSetArray.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'core/java/android/util/SparseSetArray.java') diff --git a/core/java/android/util/SparseSetArray.java b/core/java/android/util/SparseSetArray.java index c1873d76f46f..9f0f24617f5d 100644 --- a/core/java/android/util/SparseSetArray.java +++ b/core/java/android/util/SparseSetArray.java @@ -27,8 +27,8 @@ public class SparseSetArray { } /** - * Add a value at index n. - * @return FALSE when the value already existed at the given index, TRUE otherwise. + * Add a value for key n. + * @return FALSE when the value already existed for the given key, TRUE otherwise. */ public boolean add(int n, T value) { ArraySet set = mData.get(n); @@ -51,7 +51,7 @@ public class SparseSetArray { } /** - * @return whether a value exists at index n. + * @return whether the value exists for the key n. */ public boolean contains(int n, T value) { final ArraySet set = mData.get(n); @@ -62,15 +62,15 @@ public class SparseSetArray { } /** - * @return the set of items at index n + * @return the set of items of key n */ public ArraySet get(int n) { return mData.get(n); } /** - * Remove a value from index n. - * @return TRUE when the value existed at the given index and removed, FALSE otherwise. + * Remove a value for key n. + * @return TRUE when the value existed for the given key and removed, FALSE otherwise. */ public boolean remove(int n, T value) { final ArraySet set = mData.get(n); @@ -85,7 +85,7 @@ public class SparseSetArray { } /** - * Remove all values from index n. + * Remove all values for key n. */ public void remove(int n) { mData.remove(n); -- cgit v1.2.3