Home
last modified time | relevance | path

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

12345678910>>...32

/frameworks/base/core/java/com/android/internal/util/
DGrowingArrayUtils.java43 public static <T> T[] append(T[] array, int currentSize, T element) { in append() argument
44 assert currentSize <= array.length; in append()
46 if (currentSize + 1 > array.length) { in append()
49 (Class<T>) array.getClass().getComponentType(), growSize(currentSize)); in append()
50 System.arraycopy(array, 0, newArray, 0, currentSize); in append()
51 array = newArray; in append()
53 array[currentSize] = element; in append()
54 return array; in append()
61 public static int[] append(int[] array, int currentSize, int element) { in append() argument
62 assert currentSize <= array.length; in append()
[all …]
DArrayUtils.java141 public static boolean isEmpty(@Nullable Collection<?> array) { in isEmpty() argument
142 return array == null || array.isEmpty(); in isEmpty()
156 public static <T> boolean isEmpty(@Nullable T[] array) { in isEmpty() argument
157 return array == null || array.length == 0; in isEmpty()
163 public static boolean isEmpty(@Nullable int[] array) { in isEmpty() argument
164 return array == null || array.length == 0; in isEmpty()
170 public static boolean isEmpty(@Nullable long[] array) { in isEmpty() argument
171 return array == null || array.length == 0; in isEmpty()
177 public static boolean isEmpty(@Nullable byte[] array) { in isEmpty() argument
178 return array == null || array.length == 0; in isEmpty()
[all …]
DHexDump.java27 public static String dumpHexString(@Nullable byte[] array) { in dumpHexString() argument
28 if (array == null) return "(null)"; in dumpHexString()
29 return dumpHexString(array, 0, array.length); in dumpHexString()
32 public static String dumpHexString(@Nullable byte[] array, int offset, int length) in dumpHexString() argument
34 if (array == null) return "(null)"; in dumpHexString()
66 byte b = array[i]; in dumpHexString()
105 public static String toHexString(byte[] array) in toHexString() argument
107 return toHexString(array, 0, array.length, true); in toHexString()
111 public static String toHexString(byte[] array, boolean upperCase) in toHexString() argument
113 return toHexString(array, 0, array.length, upperCase); in toHexString()
[all …]
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/objectivec/Tests/
DGPBArrayTests.m95 //% GPB##NAME##Array *array = [[GPB##NAME##Array alloc] init];
96 //% XCTAssertNotNil(array);
97 //% XCTAssertEqual(array.count, 0U);
98 //% XCTAssertThrowsSpecificNamed([array valueAtIndex:0], NSException, NSRangeException);
99 //% [array enumerateValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) {
103 //% [array enumerateValuesWithOptions:NSEnumerationReverse
108 //% [array release];
112 //% GPB##NAME##Array *array = [GPB##NAME##Array arrayWithValue:VAL1];
113 //% XCTAssertNotNil(array);
114 //% XCTAssertEqual(array.count, 1U);
[all …]
/frameworks/base/core/tests/utiltests/src/android/util/
DMemoryIntArrayTest.java49 MemoryIntArray array = null; in testSize() local
51 array = new MemoryIntArray(3); in testSize()
52 assertEquals("size must be three", 3, array.size()); in testSize()
54 IoUtils.closeQuietly(array); in testSize()
60 MemoryIntArray array = null; in testGetSet() local
62 array = new MemoryIntArray(3); in testGetSet()
64 array.set(0, 1); in testGetSet()
65 array.set(1, 2); in testGetSet()
66 array.set(2, 3); in testGetSet()
68 assertEquals("First element should be 1", 1, array.get(0)); in testGetSet()
[all …]
/frameworks/base/core/java/android/os/
DHwBlob.java106 public native final void copyToBoolArray(long offset, boolean[] array, int size); in copyToBoolArray() argument
117 public native final void copyToInt8Array(long offset, byte[] array, int size); in copyToInt8Array() argument
128 public native final void copyToInt16Array(long offset, short[] array, int size); in copyToInt16Array() argument
139 public native final void copyToInt32Array(long offset, int[] array, int size); in copyToInt32Array() argument
150 public native final void copyToInt64Array(long offset, long[] array, int size); in copyToInt64Array() argument
161 public native final void copyToFloatArray(long offset, float[] array, int size); in copyToFloatArray() argument
172 public native final void copyToDoubleArray(long offset, double[] array, int size); in copyToDoubleArray() argument
325 public static Boolean[] wrapArray(@NonNull boolean[] array) { in wrapArray() argument
326 final int n = array.length; in wrapArray()
329 wrappedArray[i] = array[i]; in wrapArray()
[all …]
DHwParcel.java190 boolean[] array = new boolean[n]; in writeBoolVector()
192 array[i] = val.get(i); in writeBoolVector()
195 writeBoolVector(array); in writeBoolVector()
204 byte[] array = new byte[n]; in writeInt8Vector()
206 array[i] = val.get(i); in writeInt8Vector()
209 writeInt8Vector(array); in writeInt8Vector()
218 short[] array = new short[n]; in writeInt16Vector() local
220 array[i] = val.get(i); in writeInt16Vector()
223 writeInt16Vector(array); in writeInt16Vector()
232 int[] array = new int[n]; in writeInt32Vector() local
[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/opt/gamesdk/third_party/protobuf-3.0.0/csharp/src/Google.Protobuf/Collections/
DRepeatedField.cs54 private T[] array = EmptyArray; field in Google.Protobuf.Collections.RepeatedField
71 if (array != EmptyArray) in Clone()
73 clone.array = (T[])array.Clone(); in Clone()
74 IDeepCloneable<T>[] cloneableArray = clone.array as IDeepCloneable<T>[]; in Clone()
79 clone.array[i] = cloneableArray[i].Clone(); in Clone()
149 size += sizeCalculator(array[i]); in CalculateSize()
164 tmp += calculator(array[i]); in CalculatePackedDataSize()
196 writer(output, array[i]); in WriteTo()
206 writer(output, array[i]); in WriteTo()
213 if (array.Length < size) in EnsureSize()
[all …]
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/java/core/src/main/java/com/google/protobuf/
DIntArrayList.java60 private int[] array; field in IntArrayList
80 array = other; in IntArrayList()
97 final int[] arr = other.array; in equals()
99 if (array[i] != arr[i]) { in equals()
111 result = (31 * result) + array[i]; in hashCode()
121 return new IntArrayList(Arrays.copyOf(array, capacity), size); in mutableCopyWithCapacity()
132 return array[index]; in getInt()
149 int previousValue = array[index]; in setInt()
150 array[index] = element; in setInt()
176 if (size < array.length) { in addInt()
[all …]
DDoubleArrayList.java60 private double[] array; field in DoubleArrayList
80 array = other; in DoubleArrayList()
97 final double[] arr = other.array; in equals()
99 if (array[i] != arr[i]) { in equals()
111 long bits = Double.doubleToLongBits(array[i]); in hashCode()
122 return new DoubleArrayList(Arrays.copyOf(array, capacity), size); in mutableCopyWithCapacity()
133 return array[index]; in getDouble()
150 double previousValue = array[index]; in setDouble()
151 array[index] = element; in setDouble()
177 if (size < array.length) { in addDouble()
[all …]
DFloatArrayList.java60 private float[] array; field in FloatArrayList
80 array = other; in FloatArrayList()
97 final float[] arr = other.array; in equals()
99 if (array[i] != arr[i]) { in equals()
111 result = (31 * result) + Float.floatToIntBits(array[i]); in hashCode()
121 return new FloatArrayList(Arrays.copyOf(array, capacity), size); in mutableCopyWithCapacity()
132 return array[index]; in getFloat()
149 float previousValue = array[index]; in setFloat()
150 array[index] = element; in setFloat()
176 if (size < array.length) { in addFloat()
[all …]
DBooleanArrayList.java60 private boolean[] array; field in BooleanArrayList
80 array = other; in BooleanArrayList()
97 final boolean[] arr = other.array; in equals()
99 if (array[i] != arr[i]) { in equals()
111 result = (31 * result) + Internal.hashBoolean(array[i]); in hashCode()
121 return new BooleanArrayList(Arrays.copyOf(array, capacity), size); in mutableCopyWithCapacity()
132 return array[index]; in getBoolean()
149 boolean previousValue = array[index]; in setBoolean()
150 array[index] = element; in setBoolean()
176 if (size < array.length) { in addBoolean()
[all …]
DLongArrayList.java60 private long[] array; field in LongArrayList
80 array = other; in LongArrayList()
97 final long[] arr = other.array; in equals()
99 if (array[i] != arr[i]) { in equals()
111 result = (31 * result) + Internal.hashLong(array[i]); in hashCode()
121 return new LongArrayList(Arrays.copyOf(array, capacity), size); in mutableCopyWithCapacity()
132 return array[index]; in getLong()
149 long previousValue = array[index]; in setLong()
150 array[index] = element; in setLong()
176 if (size < array.length) { in addLong()
[all …]
/frameworks/native/opengl/tools/glgen/stubs/gles11/
Dcommon.cpp47 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) in getPointer() argument
57 *array = nullptr; in getPointer()
62 *array = jniGetNioBufferBaseArray(_env, buffer); in getPointer()
69 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { in Get() argument
70 return _env->GetByteArrayElements(array, is_copy); in Get()
75 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { in Get() argument
76 return _env->GetBooleanArrayElements(array, is_copy); in Get()
81 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { in Get() argument
82 return _env->GetCharArrayElements(array, is_copy); in Get()
87 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { in Get() argument
[all …]
/frameworks/base/core/tests/coretests/src/android/util/
DLongSparseLongArrayTest.java36 final LongSparseLongArray array = new LongSparseLongArray(5); in testSimplePut() local
39 array.put(value, value); in testSimplePut()
43 assertEquals(value, array.get(value, -1)); in testSimplePut()
44 assertEquals(-1, array.get(-value, -1)); in testSimplePut()
49 final LongSparseLongArray array = new LongSparseLongArray(5); in testSimplePutBackwards() local
52 array.put(value, value); in testSimplePutBackwards()
56 assertEquals(value, array.get(value, -1)); in testSimplePutBackwards()
57 assertEquals(-1, array.get(-value, -1)); in testSimplePutBackwards()
62 final LongSparseLongArray array = new LongSparseLongArray(5); in testMiddleInsert() local
65 array.put(value, value); in testMiddleInsert()
[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/av/media/libstagefright/
DACodecBufferChannel.cpp54 const std::shared_ptr<const std::vector<const BufferInfo>> &array, in findClientBuffer() argument
57 array->begin(), array->end(), in findClientBuffer()
62 const std::shared_ptr<const std::vector<const BufferInfo>> &array, in findBufferId() argument
65 array->begin(), array->end(), in findBufferId()
93 std::shared_ptr<const std::vector<const BufferInfo>> array( in queueInputBuffer() local
95 BufferInfoIterator it = findClientBuffer(array, buffer); in queueInputBuffer()
96 if (it == array->end()) { in queueInputBuffer()
115 std::shared_ptr<const std::vector<const BufferInfo>> array( in queueSecureInputBuffer() local
117 BufferInfoIterator it = findClientBuffer(array, buffer); in queueSecureInputBuffer()
118 if (it == array->end()) { in queueSecureInputBuffer()
[all …]
/frameworks/base/wifi/java/android/net/wifi/aware/
DTlvBufferUtils.java111 public TlvConstructor wrap(@Nullable byte[] array) { in wrap() argument
112 mArray = array; in wrap()
113 mArrayLength = (array == null) ? 0 : array.length; in wrap()
199 public TlvConstructor putByteArray(int type, @Nullable byte[] array, int offset, in putByteArray() argument
204 System.arraycopy(array, offset, mArray, mPosition, length); in putByteArray()
220 public TlvConstructor putByteArray(int type, @Nullable byte[] array) { in putByteArray() argument
221 return putByteArray(type, array, 0, (array == null) ? 0 : array.length); in putByteArray()
231 public TlvConstructor putRawByteArray(@Nullable byte[] array) { in putRawByteArray() argument
232 if (array == null) return this; in putRawByteArray()
234 checkRawLength(array.length); in putRawByteArray()
[all …]
/frameworks/base/core/java/android/hardware/camera2/utils/
DHashCodeHelpers.java36 public static int hashCode(int... array) { in hashCode() argument
37 if (array == null) { in hashCode()
49 for (int x : array) { in hashCode()
66 public static int hashCode(float... array) { in hashCode() argument
67 if (array == null) { in hashCode()
72 for (float f : array) { in hashCode()
89 public static <T> int hashCodeGeneric(T... array) { in hashCodeGeneric() argument
90 if (array == null) { in hashCodeGeneric()
95 for (T o : array) { in hashCodeGeneric()
/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.java93 private static <T> List<T> list(T... array) { in list() argument
94 return Arrays.asList(array); in list()
97 private static <T> T[] array(T... array) { in array() argument
98 return array; in array()
119 array()); in findSendToAccount_noWorkProfile()
128 array(account("abc@gmail.com"))); in findSendToAccount_noWorkProfile()
139 array(account("abc@gmail.com"), account("def@gmail.com"))); in findSendToAccount_noWorkProfile()
150 array(account("abc@gmail.com"), account("def@android.com"))); in findSendToAccount_noWorkProfile()
161 array(account("notemail"), account("abc@gmail.com"), account("def@android.com"))); in findSendToAccount_noWorkProfile()
182 array()); in findSendToAccount_withWorkProfile_noAccounts()
[all …]
/frameworks/base/core/jni/
Dandroid_opengl_GLES10Ext.cpp72 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) in getPointer() argument
82 *array = nullptr; in getPointer()
87 *array = jniGetNioBufferBaseArray(_env, buffer); in getPointer()
94 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { in Get() argument
95 return _env->GetByteArrayElements(array, is_copy); in Get()
100 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { in Get() argument
101 return _env->GetBooleanArrayElements(array, is_copy); in Get()
106 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { in Get() argument
107 return _env->GetCharArrayElements(array, is_copy); in Get()
112 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { in Get() argument
[all …]
/frameworks/base/core/java/android/util/
DArraySet.java168 final Object[] array = sTwiceBaseCache; in allocArrays() local
170 mArray = array; in allocArrays()
171 sTwiceBaseCache = (Object[]) array[0]; in allocArrays()
172 mHashes = (int[]) array[1]; in allocArrays()
173 array[0] = array[1] = null; in allocArrays()
184 Slog.wtf(TAG, "Found corrupt ArraySet cache: [0]=" + array[0] in allocArrays()
185 + " [1]=" + array[1]); in allocArrays()
193 final Object[] array = sBaseCache; in allocArrays() local
195 mArray = array; in allocArrays()
196 sBaseCache = (Object[]) array[0]; in allocArrays()
[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 …]

12345678910>>...32