OSDN Git Service

Expose removeAt(int) for parity with other sparse collections.
authorJake Wharton <jakew@google.com>
Thu, 21 Dec 2017 21:59:54 +0000 (16:59 -0500)
committerJake Wharton <jakew@google.com>
Thu, 21 Dec 2017 23:25:25 +0000 (18:25 -0500)
Bug: 70934959
Test: none
Change-Id: Ic26a9fba610d6361247e0485803b52569fbf4a38

api/current.txt
core/java/android/util/SparseBooleanArray.java

index 3fff068..3da5ca5 100644 (file)
@@ -44099,6 +44099,7 @@ package android.util {
     method public int indexOfValue(boolean);
     method public int keyAt(int);
     method public void put(int, boolean);
+    method public void removeAt(int);
     method public int size();
     method public boolean valueAt(int);
   }
index 4f76463..68d347c 100644 (file)
@@ -117,7 +117,11 @@ public class SparseBooleanArray implements Cloneable {
         }
     }
 
-    /** @hide */
+    /**
+     * Removes the mapping at the specified index.
+     * <p>
+     * For indices outside of the range {@code 0...size()-1}, the behavior is undefined.
+     */
     public void removeAt(int index) {
         System.arraycopy(mKeys, index + 1, mKeys, index, mSize - (index + 1));
         System.arraycopy(mValues, index + 1, mValues, index, mSize - (index + 1));