Searched defs:array (Results 1 - 25 of 38) sorted by relevance

12

/packages/apps/PackageInstaller/src/com/android/packageinstaller/permission/utils/
H A DArrayUtils.java27 * Checks that value is present as at least one of the elements of the array.
28 * @param array the array to check in
30 * @return true if the value is present in the array
32 public static <T> boolean contains(T[] array, T value) { argument
33 return indexOf(array, value) != -1;
37 * Return first index of {@code value} in {@code array}, or {@code -1} if
40 public static <T> int indexOf(T[] array, T value) { argument
41 if (array == null) return -1;
42 for (int i = 0; i < array
[all...]
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/
H A DCollectionUtils.java37 * Converts a sub-range of the given array to an ArrayList of the appropriate type.
38 * @param array Array to be converted.
44 public static <E> ArrayList<E> arrayAsList(@Nonnull final E[] array, final int start, argument
46 if (start < 0 || start > end || end > array.length) {
48 + " with array.length: " + array.length);
53 list.add(array[i]);
H A DStringUtils.java63 * @param tokens an array objects to be joined. Strings will be formed from
120 // Optimization: avoid creating a temporary array for characters that are
129 @Nonnull final String[] array) {
130 for (final String element : array) {
174 * Remove duplicates from an array of strings.
177 * in the array, removing the subsequent ones.
240 * Converts a range of a string to an array of code points.
244 * @return a new array of code points. At most endIndex - startIndex, but possibly less.
261 * Copies the codepoints in a CharSequence to an int array.
263 * This method assumes there is enough space in the array t
128 containsInArray(@onnull final String text, @Nonnull final String[] array) argument
644 join(@ullable final E[] array) argument
649 join(@ullable final E[] array, @Nullable final String delimiter) argument
654 toStringArray(@ullable final E[] array) argument
[all...]
/packages/inputmethods/LatinIME/native/jni/src/utils/
H A Dint_array_view.h21 #include <array>
31 * Helper class used to provide a read-only view of a given range of integer array. This class
32 * does not take ownership of the underlying integer array but is designed to be a lightweight
62 AK_FORCE_INLINE static IntArrayView fromArray(const std::array<int, N> &array) { argument
63 return IntArrayView(array.data(), array.size());
113 void copyToArray(std::array<int, N> *const buffer, const size_t offset) const {
170 using WordIdArray = std::array<int, size>;
H A Djni_data_utils.h34 static void jintarrayToVector(JNIEnv *env, jintArray array, std::vector<int> *const outVector) { argument
35 if (!array) {
39 const jsize arrayLength = env->GetArrayLength(array);
41 env->GetIntArrayRegion(array, 0 /* start */, arrayLength, outVector->data());
130 static void putBooleanToArray(JNIEnv *env, jbooleanArray array, const int index, argument
132 env->SetBooleanArrayRegion(array, index, 1 /* len */, &value);
135 static void putIntToArray(JNIEnv *env, jintArray array, const int index, const int value) { argument
136 env->SetIntArrayRegion(array, index, 1 /* len */, &value);
139 static void putFloatToArray(JNIEnv *env, jfloatArray array, const int index, argument
141 env->SetFloatArrayRegion(array, inde
[all...]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/util/
H A DHex.java19 * Basic hex operations: from byte array to string and vice versa.
54 * Quickly converts a byte array to a hexadecimal string representation.
56 * @param array byte array, possibly zero-terminated.
58 public static String encodeHex(byte[] array, boolean zeroTerminated) { argument
59 char[] cArray = new char[array.length * 2];
62 for (int i = 0; i < array.length; i++) {
63 int index = array[i] & 0xFF;
64 if (zeroTerminated && index == 0 && i == array.length-1) {
76 * Quickly converts a hexadecimal string to a byte array
[all...]
/packages/services/Car/vehicle-hal-support-lib/src/com/android/car/vehiclehal/
H A DUtils.java32 SparseArrayEntry(SparseArray<U> array, int index) { argument
33 key = array.keyAt(index);
34 value = array.valueAt(index);
41 SparseArrayIterator(SparseArray<T> array) { argument
42 mArray = array;
/packages/apps/UnifiedEmail/src/org/apache/commons/io/input/
H A DCharSequenceReader.java87 * Read the sepcified number of characters into the array.
89 * @param array The array to store the characters in
90 * @param offset The starting position in the array to store
95 public int read(char[] array, int offset, int length) { argument
99 if (array == null) {
100 throw new NullPointerException("Character array is missing");
102 if (length < 0 || (offset + length) > array.length) {
103 throw new IndexOutOfBoundsException("Array Size=" + array.length +
112 array[offse
[all...]
/packages/apps/DeskClock/src/com/android/deskclock/settings/
H A DSimpleMenuPreference.java62 private static void restoreOriginalOrder(CharSequence[] array, argument
64 final CharSequence item = array[0];
65 System.arraycopy(array, 1, array, 0, lastSelectedOriginalPosition);
66 array[lastSelectedOriginalPosition] = item;
69 private static void swapSelectedToFront(CharSequence[] array, int position) { argument
70 final CharSequence item = array[position];
71 System.arraycopy(array, 0, array, 1, position);
72 array[
75 setSelectedPosition(CharSequence[] array, int lastSelectedOriginalPosition, int position) argument
[all...]
/packages/apps/Email/tests/src/com/android/email/
H A DTestUtils.java42 /** Shortcut to create byte array */
43 public static byte[] b(int... array) { argument
44 if (array == null) {
47 byte[] ret = new byte[array.length];
49 ret[i] = (byte) array[i];
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/filters/
H A DImageFilterCurves.java44 public void populateArray(int[] array, int curveIndex) { argument
51 array[i] = (int) (curve[i] * 255);
/packages/providers/ContactsProvider/test_common/src/com/android/providers/contacts/testutil/
H A DCommonDatabaseUtils.java67 private static void fillArray(Cursor cursor, String[] array) { argument
68 for (int i = 0; i < array.length; i++) {
69 array[i] = cursor.getString(i);
98 * Returns an array of values extracted from a {@link ContentValues}, based on the order of
100 * @param values {@link ContentValues} object containing the values to convert into an array
101 * @param projection array of column names
103 * @return array of values, in the correct order as defined by the projection
/packages/apps/DocumentsUI/tests/functional/com/android/documentsui/
H A DSortDocumentUiTest.java189 private static String[] reverse(String[] array) { argument
190 String[] ret = new String[array.length];
192 for (int i = 0; i < array.length; ++i) {
193 ret[ret.length - i - 1] = array[i];
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/crop/
H A DCropMath.java30 * Gets a float array of the 2D coordinates representing a rectangles
32 * The order of the corners in the float array is:
39 * @return the float array of corners (8 floats)
67 * Takes an array of 2D coordinates representing corners and returns the
70 * @param array array of 2D coordinates
73 public static RectF trapToRect(float[] array) { argument
76 for (int i = 1; i < array.length; i += 2) {
77 float x = array[i - 1];
78 float y = array[
96 getEdgePoints(RectF imageBound, float[] array) argument
[all...]
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/task/
H A DDeleteNonRequiredAppsTaskTest.java164 private <T> Set<T> setFromArray(T... array) { argument
165 if (array == null) {
168 return new HashSet<>(Arrays.asList(array));
/packages/apps/Messaging/src/android/support/v7/mms/pdu/
H A DEncodedStringValue.java209 * @return the array of encoded strings computed by splitting this encoded
272 public static EncodedStringValue[] encodeStrings(String[] array) { argument
273 int count = array.length;
277 encodedArray[i] = new EncodedStringValue(array[i]);
/packages/apps/Messaging/src/com/android/messaging/mmslib/pdu/
H A DEncodedStringValue.java224 * @return the array of encoded strings computed by splitting this encoded
287 public static EncodedStringValue[] encodeStrings(String[] array) { argument
288 int count = array.length;
292 encodedArray[i] = new EncodedStringValue(array[i]);
/packages/apps/Gallery/src/com/android/camera/
H A DUtil.java243 public static <T> int indexOf(T [] array, T s) { argument
244 for (int i = 0; i < array.length; i++) {
245 if (array[i].equals(s)) {
/packages/apps/Gallery2/src/com/android/gallery3d/data/
H A DLocalAlbumSet.java202 // Circular shift the array range from a[i] to a[j] (inclusive). That is,
204 private static <T> void circularShiftRight(T[] array, int i, int j) { argument
205 T temp = array[j];
207 array[k] = array[k - 1];
209 array[i] = temp;
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/task/nonrequiredapps/
H A DOverlayPackagesProviderTest.java207 setStringArray(com.android.managedprovisioning.R.array.required_apps_managed_device,
212 setStringArray(com.android.managedprovisioning.R.array.vendor_required_apps_managed_device,
217 setStringArray(com.android.managedprovisioning.R.array.disallowed_apps_managed_device,
223 com.android.managedprovisioning.R.array.vendor_disallowed_apps_managed_device,
228 setStringArray(com.android.managedprovisioning.R.array.required_apps_managed_profile,
233 setStringArray(com.android.managedprovisioning.R.array.vendor_required_apps_managed_profile,
238 setStringArray(com.android.managedprovisioning.R.array.disallowed_apps_managed_profile,
244 com.android.managedprovisioning.R.array.vendor_disallowed_apps_managed_profile,
249 setStringArray(com.android.managedprovisioning.R.array.required_apps_managed_user,
254 setStringArray(com.android.managedprovisioning.R.array
299 setFromArray(T... array) argument
[all...]
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/
H A DMoreKeySpec.java36 * The more key specification object. The more keys are an array of {@link MoreKeySpec}.
179 * Split the text containing multiple key specifications separated by commas into an array of
183 * Note that an empty key specification will be eliminated from the result array.
186 * @return an array of key specification text. Null if the specified <code>text</code> is empty
236 private static String[] filterOutEmptyString(@Nullable final String[] array) { argument
237 if (array == null) {
241 for (int i = 0; i < array.length; i++) {
242 final String entry = array[i];
245 out = CollectionUtils.arrayAsList(array, 0, i);
252 return array;
[all...]
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/
H A DKeyboardThemeTests.java351 * Test that KeyboardTheme array should be sorted by descending order of
354 private static void assertSortedKeyboardThemeArray(final KeyboardTheme[] array) { argument
355 assertNotNull(array);
356 final int length = array.length;
357 assertTrue("array length=" + length, length > 0);
359 final KeyboardTheme theme = array[index];
360 final KeyboardTheme nextTheme = array[index + 1];
/packages/services/Car/car-support-lib/src/android/support/car/app/
H A DCarProxyActivity.java375 private static Integer[] convertArray(int[] array) { argument
376 Integer[] grantResults = new Integer[array.length];
377 for (int i = 0; i < array.length; i++) {
378 grantResults[i] = array[i];
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/
H A DUtils.java123 public static void swap(int[] array, int i, int j) { argument
124 int temp = array[i];
125 array[i] = array[j];
126 array[j] = temp;
/packages/services/Car/service/src/com/android/car/
H A DCarVolumeControllerFactory.java681 private void dumpVolumes(PrintWriter writer, SparseArray<Integer> array) { argument
682 for (int i = 0; i < array.size(); i++) {
683 writer.println("0x" + Integer.toHexString(array.keyAt(i)) + ":" + array.valueAt(i));

Completed in 841 milliseconds

12