Loading core/java/android/util/LongSparseArray.java +17 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,12 @@ import com.android.internal.util.ArrayUtils; * a single garbage collection step of all removed entries. This garbage collection will * need to be performed at any time the array needs to be grown or the the map size or * entry values are retrieved.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class LongSparseArray<E> implements Cloneable { private static final Object DELETED = new Object(); Loading Loading @@ -238,6 +244,11 @@ public class LongSparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * LongSparseArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public long keyAt(int index) { if (mGarbage) { Loading @@ -251,6 +262,12 @@ public class LongSparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * LongSparseArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ @SuppressWarnings("unchecked") public E valueAt(int index) { Loading core/java/android/util/LongSparseLongArray.java +17 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ import java.util.Arrays; * and deleting entries in the array. For containers holding up to hundreds of items, * the performance difference is not significant, less than 50%.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> * * @hide */ public class LongSparseLongArray implements Cloneable { Loading Loading @@ -163,6 +169,11 @@ public class LongSparseLongArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseLongArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public long keyAt(int index) { return mKeys[index]; Loading @@ -172,6 +183,12 @@ public class LongSparseLongArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseLongArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ public long valueAt(int index) { return mValues[index]; Loading core/java/android/util/SparseArray.java +17 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,12 @@ import com.android.internal.util.ArrayUtils; * a single garbage collection step of all removed entries. This garbage collection will * need to be performed at any time the array needs to be grown or the the map size or * entry values are retrieved.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class SparseArray<E> implements Cloneable { private static final Object DELETED = new Object(); Loading Loading @@ -251,6 +257,11 @@ public class SparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public int keyAt(int index) { if (mGarbage) { Loading @@ -264,6 +275,12 @@ public class SparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ @SuppressWarnings("unchecked") public E valueAt(int index) { Loading core/java/android/util/SparseBooleanArray.java +20 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ import com.android.internal.util.ArrayUtils; * HashMap, since lookups require a binary search and adds and removes require inserting * and deleting entries in the array. For containers holding up to hundreds of items, * the performance difference is not significant, less than 50%.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class SparseBooleanArray implements Cloneable { /** Loading Loading @@ -160,6 +166,11 @@ public class SparseBooleanArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseBooleanArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public int keyAt(int index) { return mKeys[index]; Loading @@ -169,6 +180,12 @@ public class SparseBooleanArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseBooleanArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ public boolean valueAt(int index) { return mValues[index]; Loading core/java/android/util/SparseIntArray.java +20 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,12 @@ import com.android.internal.util.ArrayUtils; * HashMap, since lookups require a binary search and adds and removes require inserting * and deleting entries in the array. For containers holding up to hundreds of items, * the performance difference is not significant, less than 50%.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class SparseIntArray implements Cloneable { private int[] mKeys; Loading Loading @@ -170,6 +176,11 @@ public class SparseIntArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseIntArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public int keyAt(int index) { return mKeys[index]; Loading @@ -179,6 +190,12 @@ public class SparseIntArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseIntArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ public int valueAt(int index) { return mValues[index]; Loading Loading
core/java/android/util/LongSparseArray.java +17 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,12 @@ import com.android.internal.util.ArrayUtils; * a single garbage collection step of all removed entries. This garbage collection will * need to be performed at any time the array needs to be grown or the the map size or * entry values are retrieved.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class LongSparseArray<E> implements Cloneable { private static final Object DELETED = new Object(); Loading Loading @@ -238,6 +244,11 @@ public class LongSparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * LongSparseArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public long keyAt(int index) { if (mGarbage) { Loading @@ -251,6 +262,12 @@ public class LongSparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * LongSparseArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ @SuppressWarnings("unchecked") public E valueAt(int index) { Loading
core/java/android/util/LongSparseLongArray.java +17 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ import java.util.Arrays; * and deleting entries in the array. For containers holding up to hundreds of items, * the performance difference is not significant, less than 50%.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> * * @hide */ public class LongSparseLongArray implements Cloneable { Loading Loading @@ -163,6 +169,11 @@ public class LongSparseLongArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseLongArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public long keyAt(int index) { return mKeys[index]; Loading @@ -172,6 +183,12 @@ public class LongSparseLongArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseLongArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ public long valueAt(int index) { return mValues[index]; Loading
core/java/android/util/SparseArray.java +17 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,12 @@ import com.android.internal.util.ArrayUtils; * a single garbage collection step of all removed entries. This garbage collection will * need to be performed at any time the array needs to be grown or the the map size or * entry values are retrieved.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class SparseArray<E> implements Cloneable { private static final Object DELETED = new Object(); Loading Loading @@ -251,6 +257,11 @@ public class SparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public int keyAt(int index) { if (mGarbage) { Loading @@ -264,6 +275,12 @@ public class SparseArray<E> implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ @SuppressWarnings("unchecked") public E valueAt(int index) { Loading
core/java/android/util/SparseBooleanArray.java +20 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,12 @@ import com.android.internal.util.ArrayUtils; * HashMap, since lookups require a binary search and adds and removes require inserting * and deleting entries in the array. For containers holding up to hundreds of items, * the performance difference is not significant, less than 50%.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class SparseBooleanArray implements Cloneable { /** Loading Loading @@ -160,6 +166,11 @@ public class SparseBooleanArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseBooleanArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public int keyAt(int index) { return mKeys[index]; Loading @@ -169,6 +180,12 @@ public class SparseBooleanArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseBooleanArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ public boolean valueAt(int index) { return mValues[index]; Loading
core/java/android/util/SparseIntArray.java +20 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,12 @@ import com.android.internal.util.ArrayUtils; * HashMap, since lookups require a binary search and adds and removes require inserting * and deleting entries in the array. For containers holding up to hundreds of items, * the performance difference is not significant, less than 50%.</p> * * <p>It is possible to iterate over the items in this container using * {@link #keyAt(int)} and {@link #valueAt(int)}. Iterating over the keys using * <code>keyAt(int)</code> with ascending values of the index will return the * keys in ascending order, or the values corresponding to the keys in ascending * order in the case of <code>valueAt(int)<code>.</p> */ public class SparseIntArray implements Cloneable { private int[] mKeys; Loading Loading @@ -170,6 +176,11 @@ public class SparseIntArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the key from the <code>index</code>th key-value mapping that this * SparseIntArray stores. * * <p>The keys corresponding to indices in ascending order are guaranteed to * be in ascending order, e.g., <code>keyAt(0)</code> will return the * smallest key and <code>keyAt(size()-1)</code> will return the largest * key.</p> */ public int keyAt(int index) { return mKeys[index]; Loading @@ -179,6 +190,12 @@ public class SparseIntArray implements Cloneable { * Given an index in the range <code>0...size()-1</code>, returns * the value from the <code>index</code>th key-value mapping that this * SparseIntArray stores. * * <p>The values corresponding to indices in ascending order are guaranteed * to be associated with keys in ascending order, e.g., * <code>valueAt(0)</code> will return the value associated with the * smallest key and <code>valueAt(size()-1)</code> will return the value * associated with the largest key.</p> */ public int valueAt(int index) { return mValues[index]; Loading