mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Merge "Add two panel home support for page binding logic" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
adbe369451
@@ -16,11 +16,13 @@
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* A wrapper over IntArray implementing a growing set of int primitives.
|
||||
* The elements in the array are sorted in ascending order.
|
||||
*/
|
||||
public class IntSet {
|
||||
public class IntSet implements Iterable<Integer> {
|
||||
|
||||
final IntArray mArray = new IntArray();
|
||||
|
||||
@@ -71,6 +73,9 @@ public class IntSet {
|
||||
return (obj instanceof IntSet) && ((IntSet) obj).mArray.equals(mArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the wrapped IntArray. The elements in the array are sorted in ascending order.
|
||||
*/
|
||||
public IntArray getArray() {
|
||||
return mArray;
|
||||
}
|
||||
@@ -88,4 +93,21 @@ public class IntSet {
|
||||
Arrays.sort(set.mArray.mValues, 0, set.mArray.mSize);
|
||||
return set;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an IntSet with the given values.
|
||||
*/
|
||||
public static IntSet wrap(int... array) {
|
||||
return wrap(IntArray.wrap(array));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Integer> iterator() {
|
||||
return mArray.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "IntSet{" + mArray.toConcatString() + '}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user