Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40668,6 +40668,7 @@ package android.util { method public E get(int, E); method public int indexOfKey(int); method public int indexOfValue(E); method public int indexOfValueByValue(E); method public int keyAt(int); method public void put(int, E); method public void remove(int); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43834,6 +43834,7 @@ package android.util { method public E get(int, E); method public int indexOfKey(int); method public int indexOfValue(E); method public int indexOfValueByValue(E); method public int keyAt(int); method public void put(int, E); method public void remove(int); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40748,6 +40748,7 @@ package android.util { method public E get(int, E); method public int indexOfKey(int); method public int indexOfValue(E); method public int indexOfValueByValue(E); method public int keyAt(int); method public void put(int, E); method public void remove(int); core/java/android/util/SparseArray.java +32 −2 Original line number Diff line number Diff line Loading @@ -346,10 +346,40 @@ public class SparseArray<E> implements Cloneable { gc(); } for (int i = 0; i < mSize; i++) if (mValues[i] == value) for (int i = 0; i < mSize; i++) { if (mValues[i] == value) { return i; } } return -1; } /** * Returns an index for which {@link #valueAt} would return the * specified key, or a negative number if no keys map to the * specified value. * <p>Beware that this is a linear search, unlike lookups by key, * and that multiple keys can map to the same value and this will * find only one of them. * <p>Note also that this method uses {@code equals} unlike {@code indexOfValue}. */ public int indexOfValueByValue(E value) { if (mGarbage) { gc(); } for (int i = 0; i < mSize; i++) { if (value == null) { if (mValues[i] == null) { return i; } } else { if (value.equals(mValues[i])) { return i; } } } return -1; } Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40668,6 +40668,7 @@ package android.util { method public E get(int, E); method public int indexOfKey(int); method public int indexOfValue(E); method public int indexOfValueByValue(E); method public int keyAt(int); method public void put(int, E); method public void remove(int);
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -43834,6 +43834,7 @@ package android.util { method public E get(int, E); method public int indexOfKey(int); method public int indexOfValue(E); method public int indexOfValueByValue(E); method public int keyAt(int); method public void put(int, E); method public void remove(int);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40748,6 +40748,7 @@ package android.util { method public E get(int, E); method public int indexOfKey(int); method public int indexOfValue(E); method public int indexOfValueByValue(E); method public int keyAt(int); method public void put(int, E); method public void remove(int);
core/java/android/util/SparseArray.java +32 −2 Original line number Diff line number Diff line Loading @@ -346,10 +346,40 @@ public class SparseArray<E> implements Cloneable { gc(); } for (int i = 0; i < mSize; i++) if (mValues[i] == value) for (int i = 0; i < mSize; i++) { if (mValues[i] == value) { return i; } } return -1; } /** * Returns an index for which {@link #valueAt} would return the * specified key, or a negative number if no keys map to the * specified value. * <p>Beware that this is a linear search, unlike lookups by key, * and that multiple keys can map to the same value and this will * find only one of them. * <p>Note also that this method uses {@code equals} unlike {@code indexOfValue}. */ public int indexOfValueByValue(E value) { if (mGarbage) { gc(); } for (int i = 0; i < mSize; i++) { if (value == null) { if (mValues[i] == null) { return i; } } else { if (value.equals(mValues[i])) { return i; } } } return -1; } Loading