Home
last modified time | relevance | path

Searched refs:array (Results 1 – 25 of 578) sorted by relevance

12345678910>>...24

/frameworks/support/v7/appcompat/src/android/support/v7/content/res/
DGrowingArrayUtils.java40 public static <T> T[] append(T[] array, int currentSize, T element) { in append() argument
41 assert currentSize <= array.length; in append()
43 if (currentSize + 1 > array.length) { in append()
44 T[] newArray = (T[]) Array.newInstance(array.getClass().getComponentType(), in append()
46 System.arraycopy(array, 0, newArray, 0, currentSize); in append()
47 array = newArray; in append()
49 array[currentSize] = element; in append()
50 return array; in append()
56 public static int[] append(int[] array, int currentSize, int element) { in append() argument
57 assert currentSize <= array.length; in append()
[all …]
/frameworks/base/core/java/com/android/internal/util/
DGrowingArrayUtils.java40 public static <T> T[] append(T[] array, int currentSize, T element) { in append() argument
41 assert currentSize <= array.length; in append()
43 if (currentSize + 1 > array.length) { in append()
46 (Class<T>) array.getClass().getComponentType(), growSize(currentSize)); in append()
47 System.arraycopy(array, 0, newArray, 0, currentSize); in append()
48 array = newArray; in append()
50 array[currentSize] = element; in append()
51 return array; in append()
57 public static int[] append(int[] array, int currentSize, int element) { in append() argument
58 assert currentSize <= array.length; in append()
[all …]
DArrayUtils.java132 public static boolean isEmpty(@Nullable Collection<?> array) { in isEmpty() argument
133 return array == null || array.isEmpty(); in isEmpty()
139 public static <T> boolean isEmpty(@Nullable T[] array) { in isEmpty() argument
140 return array == null || array.length == 0; in isEmpty()
146 public static boolean isEmpty(@Nullable int[] array) { in isEmpty() argument
147 return array == null || array.length == 0; in isEmpty()
153 public static boolean isEmpty(@Nullable long[] array) { in isEmpty() argument
154 return array == null || array.length == 0; in isEmpty()
160 public static boolean isEmpty(@Nullable byte[] array) { in isEmpty() argument
161 return array == null || array.length == 0; in isEmpty()
[all …]
DHexDump.java24 public static String dumpHexString(byte[] array) in dumpHexString() argument
26 return dumpHexString(array, 0, array.length); in dumpHexString()
29 public static String dumpHexString(byte[] array, int offset, int length) in dumpHexString() argument
62 byte b = array[i]; in dumpHexString()
100 public static String toHexString(byte[] array) in toHexString() argument
102 return toHexString(array, 0, array.length, true); in toHexString()
105 public static String toHexString(byte[] array, boolean upperCase) in toHexString() argument
107 return toHexString(array, 0, array.length, upperCase); in toHexString()
110 public static String toHexString(byte[] array, int offset, int length) in toHexString() argument
112 return toHexString(array, offset, length, true); in toHexString()
[all …]
/frameworks/base/core/tests/utiltests/src/android/util/
DMemoryIntArrayTest.java44 MemoryIntArray array = null; in testSize() local
46 array = new MemoryIntArray(3); in testSize()
47 assertEquals("size must be three", 3, array.size()); in testSize()
49 IoUtils.closeQuietly(array); in testSize()
55 MemoryIntArray array = null; in testGetSet() local
57 array = new MemoryIntArray(3); in testGetSet()
59 array.set(0, 1); in testGetSet()
60 array.set(1, 2); in testGetSet()
61 array.set(2, 3); in testGetSet()
63 assertEquals("First element should be 1", 1, array.get(0)); in testGetSet()
[all …]
/frameworks/base/core/java/android/os/
DHwParcel.java70 boolean[] array = new boolean[n]; in writeBoolVector()
72 array[i] = val.get(i); in writeBoolVector()
75 writeBoolVector(array); in writeBoolVector()
80 byte[] array = new byte[n]; in writeInt8Vector()
82 array[i] = val.get(i); in writeInt8Vector()
85 writeInt8Vector(array); in writeInt8Vector()
90 short[] array = new short[n]; in writeInt16Vector() local
92 array[i] = val.get(i); in writeInt16Vector()
95 writeInt16Vector(array); in writeInt16Vector()
100 int[] array = new int[n]; in writeInt32Vector() local
[all …]
DHwBlob.java59 public static Boolean[] wrapArray(@NonNull boolean[] array) { in wrapArray() argument
60 final int n = array.length; in wrapArray()
63 wrappedArray[i] = array[i]; in wrapArray()
68 public static Long[] wrapArray(@NonNull long[] array) { in wrapArray() argument
69 final int n = array.length; in wrapArray()
72 wrappedArray[i] = array[i]; in wrapArray()
77 public static Byte[] wrapArray(@NonNull byte[] array) { in wrapArray() argument
78 final int n = array.length; in wrapArray()
81 wrappedArray[i] = array[i]; in wrapArray()
86 public static Short[] wrapArray(@NonNull short[] array) { in wrapArray() argument
[all …]
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/
DByteArrayHelpers.java40 public static byte[] toByteArray(byte[] array) { in toByteArray() argument
41 return array; in toByteArray()
50 public static byte[] toByteArray(short[] array) { in toByteArray() argument
51 return toByteArray(array, Short.SIZE); in toByteArray()
60 public static byte[] toByteArray(char[] array) { in toByteArray() argument
61 return toByteArray(array, Character.SIZE); in toByteArray()
69 public static byte[] toByteArray(int[] array) { in toByteArray() argument
70 return toByteArray(array, Integer.SIZE); in toByteArray()
78 public static byte[] toByteArray(long[] array) { in toByteArray() argument
79 return toByteArray(array, Long.SIZE); in toByteArray()
[all …]
/frameworks/base/core/tests/coretests/src/android/util/
DLongSparseLongArrayTest.java33 final LongSparseLongArray array = new LongSparseLongArray(5); in testSimplePut() local
36 array.put(value, value); in testSimplePut()
40 assertEquals(value, array.get(value, -1)); in testSimplePut()
41 assertEquals(-1, array.get(-value, -1)); in testSimplePut()
46 final LongSparseLongArray array = new LongSparseLongArray(5); in testSimplePutBackwards() local
49 array.put(value, value); in testSimplePutBackwards()
53 assertEquals(value, array.get(value, -1)); in testSimplePutBackwards()
54 assertEquals(-1, array.get(-value, -1)); in testSimplePutBackwards()
59 final LongSparseLongArray array = new LongSparseLongArray(5); in testMiddleInsert() local
62 array.put(value, value); in testMiddleInsert()
[all …]
/frameworks/av/media/libstagefright/
DACodecBufferChannel.cpp49 const std::shared_ptr<const std::vector<const BufferInfo>> &array, in findClientBuffer() argument
52 array->begin(), array->end(), in findClientBuffer()
57 const std::shared_ptr<const std::vector<const BufferInfo>> &array, in findBufferId() argument
60 array->begin(), array->end(), in findBufferId()
88 std::shared_ptr<const std::vector<const BufferInfo>> array( in queueInputBuffer() local
90 BufferInfoIterator it = findClientBuffer(array, buffer); in queueInputBuffer()
91 if (it == array->end()) { in queueInputBuffer()
110 std::shared_ptr<const std::vector<const BufferInfo>> array( in queueSecureInputBuffer() local
112 BufferInfoIterator it = findClientBuffer(array, buffer); in queueSecureInputBuffer()
113 if (it == array->end()) { in queueSecureInputBuffer()
[all …]
/frameworks/native/opengl/tools/glgen/stubs/gles11/
Dcommon.cpp77 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) in getPointer() argument
91 *array = NULL; in getPointer()
95 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, in getPointer()
105 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { in Get() argument
106 return _env->GetByteArrayElements(array, is_copy); in Get()
111 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { in Get() argument
112 return _env->GetBooleanArrayElements(array, is_copy); in Get()
117 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { in Get() argument
118 return _env->GetCharArrayElements(array, is_copy); in Get()
123 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { in Get() argument
[all …]
/frameworks/base/keystore/java/android/security/keystore/
DArrayUtils.java27 public static String[] nullToEmpty(String[] array) { in nullToEmpty() argument
28 return (array != null) ? array : EmptyArray.STRING; in nullToEmpty()
31 public static String[] cloneIfNotEmpty(String[] array) { in cloneIfNotEmpty() argument
32 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty()
35 public static byte[] cloneIfNotEmpty(byte[] array) { in cloneIfNotEmpty() argument
36 return ((array != null) && (array.length > 0)) ? array.clone() : array; in cloneIfNotEmpty()
/frameworks/base/core/java/android/util/
DArraySet.java158 final Object[] array = sTwiceBaseCache; in allocArrays() local
160 mArray = array; in allocArrays()
161 sTwiceBaseCache = (Object[]) array[0]; in allocArrays()
162 mHashes = (int[]) array[1]; in allocArrays()
163 array[0] = array[1] = null; in allocArrays()
174 Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] in allocArrays()
175 + " [1]=" + array[1]); in allocArrays()
183 final Object[] array = sBaseCache; in allocArrays() local
185 mArray = array; in allocArrays()
186 sBaseCache = (Object[]) array[0]; in allocArrays()
[all …]
DArrayMap.java197 final Object[] array = mTwiceBaseCache; in allocArrays() local
198 mArray = array; in allocArrays()
199 mTwiceBaseCache = (Object[])array[0]; in allocArrays()
200 mHashes = (int[])array[1]; in allocArrays()
201 array[0] = array[1] = null; in allocArrays()
211 final Object[] array = mBaseCache; in allocArrays() local
212 mArray = array; in allocArrays()
213 mBaseCache = (Object[])array[0]; in allocArrays()
214 mHashes = (int[])array[1]; in allocArrays()
215 array[0] = array[1] = null; in allocArrays()
[all …]
/frameworks/base/core/java/android/hardware/camera2/utils/
DHashCodeHelpers.java33 public static int hashCode(int... array) { in hashCode() argument
34 if (array == null) { in hashCode()
46 for (int x : array) { in hashCode()
63 public static int hashCode(float... array) { in hashCode() argument
64 if (array == null) { in hashCode()
69 for (float f : array) { in hashCode()
86 public static <T> int hashCodeGeneric(T... array) { in hashCodeGeneric() argument
87 if (array == null) { in hashCodeGeneric()
92 for (T o : array) { in hashCodeGeneric()
DArrayUtils.java34 public static <T> int getArrayIndex(T[] array, T needle) { in getArrayIndex() argument
35 if (array == null) { in getArrayIndex()
40 for (T elem : array) { in getArrayIndex()
51 public static int getArrayIndex(int[] array, int needle) { in getArrayIndex() argument
52 if (array == null) { in getArrayIndex()
55 for (int i = 0; i < array.length; ++i) { in getArrayIndex()
56 if (array[i] == needle) { in getArrayIndex()
166 public static boolean contains(int[] array, int elem) { in contains() argument
167 return getArrayIndex(array, elem) != -1; in contains()
177 public static <T> boolean contains(T[] array, T elem) { in contains() argument
[all …]
/frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/
DArrayMapTests.java121 private static boolean compareMaps(HashMap map, ArrayMap array) { in compareMaps() argument
122 if (map.size() != array.size()) { in compareMaps()
123 Log.e("test", "Bad size: expected " + map.size() + ", got " + array.size()); in compareMaps()
130 Object gotValue = array.get(entry.getKey()); in compareMaps()
138 for (int i=0; i<array.size(); i++) { in compareMaps()
139 Object gotValue = array.valueAt(i); in compareMaps()
140 Object key = array.keyAt(i); in compareMaps()
149 if (map.entrySet().hashCode() != array.entrySet().hashCode()) { in compareMaps()
152 + Integer.toHexString(array.entrySet().hashCode())); in compareMaps()
156 if (!map.entrySet().equals(array.entrySet())) { in compareMaps()
[all …]
/frameworks/base/packages/Shell/tests/src/com/android/shell/
DBugreportProgressServiceTest.java94 private static <T> List<T> list(T... array) { in list() argument
95 return Arrays.asList(array); in list()
98 private static <T> T[] array(T... array) { in array() argument
99 return array; in array()
120 array()); in findSendToAccount_noWorkProfile()
129 array(account("abc@gmail.com"))); in findSendToAccount_noWorkProfile()
140 array(account("abc@gmail.com"), account("def@gmail.com"))); in findSendToAccount_noWorkProfile()
151 array(account("abc@gmail.com"), account("def@android.com"))); in findSendToAccount_noWorkProfile()
162 array(account("notemail"), account("abc@gmail.com"), account("def@android.com"))); in findSendToAccount_noWorkProfile()
183 array()); in findSendToAccount_withWorkProfile_noAccounts()
[all …]
/frameworks/base/core/java/android/bluetooth/le/
DBluetoothLeUtils.java38 static String toString(SparseArray<byte[]> array) { in toString() argument
39 if (array == null) { in toString()
42 if (array.size() == 0) { in toString()
47 for (int i = 0; i < array.size(); ++i) { in toString()
48 buffer.append(array.keyAt(i)).append("=").append(Arrays.toString(array.valueAt(i))); in toString()
82 static boolean equals(SparseArray<byte[]> array, SparseArray<byte[]> otherArray) { in equals() argument
83 if (array == otherArray) { in equals()
86 if (array == null || otherArray == null) { in equals()
89 if (array.size() != otherArray.size()) { in equals()
94 for (int i = 0; i < array.size(); ++i) { in equals()
[all …]
/frameworks/support/compat/java/android/support/v4/util/
DArraySet.java164 final Object[] array = sTwiceBaseCache; in allocArrays() local
165 mArray = array; in allocArrays()
166 sTwiceBaseCache = (Object[]) array[0]; in allocArrays()
167 mHashes = (int[]) array[1]; in allocArrays()
168 array[0] = array[1] = null; in allocArrays()
180 final Object[] array = sBaseCache; in allocArrays() local
181 mArray = array; in allocArrays()
182 sBaseCache = (Object[]) array[0]; in allocArrays()
183 mHashes = (int[]) array[1]; in allocArrays()
184 array[0] = array[1] = null; in allocArrays()
[all …]
DSimpleArrayMap.java167 final Object[] array = mTwiceBaseCache; in allocArrays() local
168 mArray = array; in allocArrays()
169 mTwiceBaseCache = (Object[])array[0]; in allocArrays()
170 mHashes = (int[])array[1]; in allocArrays()
171 array[0] = array[1] = null; in allocArrays()
181 final Object[] array = mBaseCache; in allocArrays() local
182 mArray = array; in allocArrays()
183 mBaseCache = (Object[])array[0]; in allocArrays()
184 mHashes = (int[])array[1]; in allocArrays()
185 array[0] = array[1] = null; in allocArrays()
[all …]
/frameworks/base/core/jni/
Dandroid_opengl_GLES10Ext.cpp103 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) in getPointer() argument
117 *array = NULL; in getPointer()
121 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, in getPointer()
131 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { in Get() argument
132 return _env->GetByteArrayElements(array, is_copy); in Get()
137 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { in Get() argument
138 return _env->GetBooleanArrayElements(array, is_copy); in Get()
143 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { in Get() argument
144 return _env->GetCharArrayElements(array, is_copy); in Get()
149 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { in Get() argument
[all …]
/frameworks/base/graphics/java/android/graphics/
DColorMatrixColorFilter.java49 public ColorMatrixColorFilter(@NonNull float[] array) { in ColorMatrixColorFilter() argument
50 if (array.length < 20) { in ColorMatrixColorFilter()
53 mMatrix.set(array); in ColorMatrixColorFilter()
107 public void setColorMatrixArray(@Nullable float[] array) { in setColorMatrixArray() argument
110 if (array == null) { in setColorMatrixArray()
113 if (array.length < 20) { in setColorMatrixArray()
116 mMatrix.set(array); in setColorMatrixArray()
125 private static native long nativeColorMatrixFilter(float[] array); in nativeColorMatrixFilter() argument
/frameworks/base/core/java/com/android/internal/app/procstats/
DSparseMappingTable.java131 long[] array = list.get(whichArray); in getOrAddKey() local
132 if (mParent.mNextIndex + count > array.length) { in getOrAddKey()
134 array = new long[ARRAY_SIZE]; in getOrAddKey()
135 list.add(array); in getOrAddKey()
197 final long[] array = mParent.mLongs.get(getArrayFromKey(key)); in getValue() local
198 return array[getIndexFromKey(key) + index]; in getValue()
231 final long[] array = mParent.mLongs.get(getArrayFromKey(key)); in getValueForId() local
232 return array[getIndexFromKey(key) + index]; in getValueForId()
283 final long[] array = mParent.mLongs.get(getArrayFromKey(key)); in setValue() local
284 array[getIndexFromKey(key) + index] = value; in setValue()
[all …]
/frameworks/base/wifi/java/android/net/wifi/aware/
DTlvBufferUtils.java96 public TlvConstructor wrap(@Nullable byte[] array) { in wrap() argument
97 mArray = array; in wrap()
98 mArrayLength = (array == null) ? 0 : array.length; in wrap()
170 public TlvConstructor putByteArray(int type, @Nullable byte[] array, int offset, in putByteArray() argument
175 System.arraycopy(array, offset, mArray, mPosition, length); in putByteArray()
191 public TlvConstructor putByteArray(int type, @Nullable byte[] array) { in putByteArray() argument
192 return putByteArray(type, array, 0, (array == null) ? 0 : array.length); in putByteArray()
431 public TlvIterable(int typeSize, int lengthSize, @Nullable byte[] array) { in TlvIterable() argument
438 mArray = array; in TlvIterable()
439 mArrayLength = (array == null) ? 0 : array.length; in TlvIterable()
[all …]

12345678910>>...24