diff options
| author | Dianne Hackborn <hackbod@google.com> | 2013-07-16 13:23:55 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2013-07-16 17:08:04 -0700 |
| commit | 3e82ba1a67b0c756ab6a289985f4cfc53725b311 (patch) | |
| tree | 1683ef4d66151ff27b7afe1c7257abceee69654b /core/java/android/util/ArraySet.java | |
| parent | cdae0f3c608ed5aee5ddbdf9c54ac86a5619e64b (diff) | |
Make ArrayMap public! :)
Also do some tweaking of the various container classes
to synchronize them with the support lib and make it
easier to copy code between the two.
And update activity/fragment to use ArrayMap.
Change-Id: I3cfe82392a17119dfc72c3d9961f64e1914f42be
Diffstat (limited to 'core/java/android/util/ArraySet.java')
| -rw-r--r-- | core/java/android/util/ArraySet.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/java/android/util/ArraySet.java b/core/java/android/util/ArraySet.java index 4e1d32c1de68..1648ec925c62 100644 --- a/core/java/android/util/ArraySet.java +++ b/core/java/android/util/ArraySet.java @@ -85,7 +85,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { return ~0; } - int index = SparseArray.binarySearch(mHashes, N, hash); + int index = ContainerHelpers.binarySearch(mHashes, N, hash); // If the hash code wasn't found, then we have no entry for this key. if (index < 0) { @@ -187,8 +187,8 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { * will grow once items are added to it. */ public ArraySet() { - mHashes = SparseArray.EMPTY_INTS; - mArray = SparseArray.EMPTY_OBJECTS; + mHashes = ContainerHelpers.EMPTY_INTS; + mArray = ContainerHelpers.EMPTY_OBJECTS; mSize = 0; } @@ -197,8 +197,8 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { */ public ArraySet(int capacity) { if (capacity == 0) { - mHashes = SparseArray.EMPTY_INTS; - mArray = SparseArray.EMPTY_OBJECTS; + mHashes = ContainerHelpers.EMPTY_INTS; + mArray = ContainerHelpers.EMPTY_OBJECTS; } else { allocArrays(capacity); } @@ -223,8 +223,8 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { public void clear() { if (mSize != 0) { freeArrays(mHashes, mArray, mSize); - mHashes = SparseArray.EMPTY_INTS; - mArray = SparseArray.EMPTY_OBJECTS; + mHashes = ContainerHelpers.EMPTY_INTS; + mArray = ContainerHelpers.EMPTY_OBJECTS; mSize = 0; } } @@ -371,8 +371,8 @@ public final class ArraySet<E> implements Collection<E>, Set<E> { // Now empty. if (DEBUG) Log.d(TAG, "remove: shrink from " + mHashes.length + " to 0"); freeArrays(mHashes, mArray, mSize); - mHashes = SparseArray.EMPTY_INTS; - mArray = SparseArray.EMPTY_OBJECTS; + mHashes = ContainerHelpers.EMPTY_INTS; + mArray = ContainerHelpers.EMPTY_OBJECTS; mSize = 0; } else { if (mHashes.length > (BASE_SIZE*2) && mSize < mHashes.length/3) { |
