/libcore/ojluni/src/main/java/java/lang/reflect/ |
D | Array.java | 137 public static int getLength(Object array) in getLength() argument 139 if (array instanceof Object[]) { in getLength() 140 return ((Object[]) array).length; in getLength() 141 } else if (array instanceof boolean[]) { in getLength() 142 return ((boolean[]) array).length; in getLength() 143 } else if (array instanceof byte[]) { in getLength() 144 return ((byte[]) array).length; in getLength() 145 } else if (array instanceof char[]) { in getLength() 146 return ((char[]) array).length; in getLength() 147 } else if (array instanceof double[]) { in getLength() [all …]
|
/libcore/json/src/test/java/libcore/org/json/ |
D | JSONArrayTest.java | 36 JSONArray array = new JSONArray(); in testEmptyArray() local 37 assertEquals(0, array.length()); in testEmptyArray() 38 assertEquals("", array.join(" AND ")); in testEmptyArray() 40 array.get(0); in testEmptyArray() 45 array.getBoolean(0); in testEmptyArray() 50 assertEquals("[]", array.toString()); in testEmptyArray() 51 assertEquals("[]", array.toString(4)); in testEmptyArray() 54 assertTrue(array.isNull(0)); in testEmptyArray() 55 assertNull(array.opt(0)); in testEmptyArray() 56 assertFalse(array.optBoolean(0)); in testEmptyArray() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | OldAndroidArrayListTest.java | 30 ArrayList array = new ArrayList(); in testArrayList() local 31 assertEquals(0, array.size()); in testArrayList() 32 assertTrue(array.isEmpty()); in testArrayList() 34 array.add(new Integer(0)); in testArrayList() 35 array.add(0, new Integer(1)); in testArrayList() 36 array.add(1, new Integer(2)); in testArrayList() 37 array.add(new Integer(3)); in testArrayList() 38 array.add(new Integer(1)); in testArrayList() 40 assertEquals(5, array.size()); in testArrayList() 41 assertFalse(array.isEmpty()); in testArrayList() [all …]
|
/libcore/benchmarks/src/benchmarks/ |
D | DeepArrayOpsBenchmark.java | 29 private Object[] array; field in DeepArrayOpsBenchmark 33 array = new Object[arrayLength * 14]; in setUp() 36 array[i] = new IntWrapper(i); in setUp() 39 array[i + 1] = new16ElementObjectarray(); in setUp() 42 array[i + 2] = new boolean[16]; in setUp() 45 array[i + 3] = new byte[16]; in setUp() 48 array[i + 4] = new char[16]; in setUp() 51 array[i + 5] = new short[16]; in setUp() 54 array[i + 6] = new float[16]; in setUp() 57 array[i + 7] = new long[16]; in setUp() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | PriorityQueueTest.java | 46 Integer[] array = { 2, 45, 7, -12, 9 }; in test_iterator() local 47 for (int i = 0; i < array.length; i++) { in test_iterator() 48 integerQueue.offer(array[i]); in test_iterator() 57 Arrays.sort(array); in test_iterator() 59 assertTrue(Arrays.equals(array, resultArray)); in test_iterator() 115 Integer[] array = { 2, 45, 7, -12, 9 }; in test_iterator_remove() local 116 for (int i = 0; i < array.length; i++) { in test_iterator_remove() 117 integerQueue.offer(array[i]); in test_iterator_remove() 121 for (int i = 0; i < array.length; i++) { in test_iterator_remove() 127 assertEquals(array.length - 1, integerQueue.size()); in test_iterator_remove() [all …]
|
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/ |
D | LongNodeTest.java | 43 long[] array = new long[size]; in createSizes() local 44 for (int i = 0; i < array.length; i++) { in createSizes() 45 array[i] = i; in createSizes() 50 nodes.add(Nodes.node(array)); in createSizes() 51 nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array)))); in createSizes() 52 nodes.add(tree(toList(array), l -> Nodes.node(toLongArray(l)))); in createSizes() 53 nodes.add(fill(array, Nodes.longBuilder(array.length))); in createSizes() 54 nodes.add(fill(array, Nodes.longBuilder())); in createSizes() 57 params.add(new Object[]{array, node}); in createSizes() 65 private static void assertEqualsListLongArray(List<Long> list, long[] array) { in assertEqualsListLongArray() argument [all …]
|
D | IntNodeTest.java | 43 int[] array = new int[size]; in createSizes() local 44 for (int i = 0; i < array.length; i++) { in createSizes() 45 array[i] = i; in createSizes() 50 nodes.add(Nodes.node(array)); in createSizes() 51 nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array)))); in createSizes() 52 nodes.add(tree(toList(array), l -> Nodes.node(toIntArray(l)))); in createSizes() 53 nodes.add(fill(array, Nodes.intBuilder(array.length))); in createSizes() 54 nodes.add(fill(array, Nodes.intBuilder())); in createSizes() 57 params.add(new Object[]{array, node}); in createSizes() 65 private static void assertEqualsListIntArray(List<Integer> list, int[] array) { in assertEqualsListIntArray() argument [all …]
|
D | DoubleNodeTest.java | 43 double[] array = new double[size]; in createSizes() local 44 for (int i = 0; i < array.length; i++) { in createSizes() 45 array[i] = i; in createSizes() 50 nodes.add(Nodes.node(array)); in createSizes() 51 nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array)))); in createSizes() 52 nodes.add(tree(toList(array), l -> Nodes.node(toDoubleArray(l)))); in createSizes() 53 nodes.add(fill(array, Nodes.doubleBuilder(array.length))); in createSizes() 54 nodes.add(fill(array, Nodes.doubleBuilder())); in createSizes() 57 params.add(new Object[]{array, node}); in createSizes() 65 private static void assertEqualsListDoubleArray(List<Double> list, double[] array) { in assertEqualsListDoubleArray() argument [all …]
|
D | NodeTest.java | 43 Integer[] array = new Integer[size]; in createSizes() local 44 for (int i = 0; i < array.length; i++) { in createSizes() 45 array[i] = i; in createSizes() 49 nodes.add(Nodes.node(array)); in createSizes() 50 nodes.add(Nodes.node(Arrays.asList(array))); in createSizes() 51 nodes.add(degenerateTree(Arrays.asList(array).iterator())); in createSizes() 52 … nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l.toArray(new Integer[l.size()])))); in createSizes() 53 nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l))); in createSizes() 54 … nodes.add(fill(array, Nodes.builder(array.length, LambdaTestHelpers.integerArrayGenerator))); in createSizes() 55 nodes.add(fill(array, Nodes.builder())); in createSizes() [all …]
|
D | SpinedBufferTest.java | 65 int[] array = IntStream.range(0, size).toArray(); in createSpinedBuffer() local 68 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 69 params.add(new Object[]{array, sb}); in createSpinedBuffer() 72 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 73 params.add(new Object[]{array, sb}); in createSpinedBuffer() 76 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 77 params.add(new Object[]{array, sb}); in createSpinedBuffer() 80 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 81 params.add(new Object[]{array, sb}); in createSpinedBuffer() 88 public void testSpliterator(int[] array, SpinedBuffer<Integer> sb) { in testSpliterator() argument [all …]
|
/libcore/ojluni/src/main/java/java/util/stream/ |
D | Nodes.java | 139 static <T> Node<T> node(T[] array) { in node() argument 140 return new ArrayNode<>(array); in node() 192 static Node.OfInt node(int[] array) { in node() argument 193 return new IntArrayNode(array); in node() 229 static Node.OfLong node(final long[] array) { in node() argument 230 return new LongArrayNode(array); in node() 266 static Node.OfDouble node(final double[] array) { in node() argument 267 return new DoubleArrayNode(array); in node() 324 P_OUT[] array = generator.apply((int) size); in collect() local 325 new SizedCollectorTask.OfRef<>(spliterator, helper, array).invoke(); in collect() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | PriorityBlockingQueue.java | 288 private void tryGrow(Object[] array, int oldCap) { in tryGrow() argument 303 if (newCap > oldCap && queue == array) in tryGrow() 312 if (newArray != null && queue == array) { in tryGrow() 314 System.arraycopy(array, 0, newArray, 0, oldCap); in tryGrow() 326 Object[] array = queue; in dequeue() local 327 E result = (E) array[0]; in dequeue() 328 E x = (E) array[n]; in dequeue() 329 array[n] = null; in dequeue() 332 siftDownComparable(0, x, array, n); in dequeue() 334 siftDownUsingComparator(0, x, array, n, cmp); in dequeue() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/ |
D | LongBufferTest.java | 51 long array[] = buf.array(); in testArray() local 52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 68 long array[] = buf.array(); in testArrayOffset() local 69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | FloatBufferTest.java | 51 float array[] = buf.array(); in testArray() local 52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 68 float array[] = buf.array(); in testArrayOffset() local 69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | IntBufferTest.java | 51 int array[] = buf.array(); in testArray() local 52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 68 int array[] = buf.array(); in testArrayOffset() local 69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | ShortBufferTest.java | 50 short array[] = buf.array(); in testArray() local 51 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 53 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 54 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 56 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 57 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 60 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 63 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 67 short array[] = buf.array(); in testArrayOffset() local 68 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | DoubleBufferTest.java | 75 double array[] = buf.array(); in testArray() local 76 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 78 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 79 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 81 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 82 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 85 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 88 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 92 double array[] = buf.array(); in testArrayOffset() local 93 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | WrappedFloatBufferTest.java | 39 float array[] = new float[20]; in testWrappedFloatBuffer_IllegalArg() local 41 FloatBuffer.wrap(array, -1, 0); in testWrappedFloatBuffer_IllegalArg() 47 FloatBuffer.wrap(array, 21, 0); in testWrappedFloatBuffer_IllegalArg() 53 FloatBuffer.wrap(array, 0, -1); in testWrappedFloatBuffer_IllegalArg() 59 FloatBuffer.wrap(array, 0, 21); in testWrappedFloatBuffer_IllegalArg() 65 FloatBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedFloatBuffer_IllegalArg() 71 FloatBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedFloatBuffer_IllegalArg() 82 FloatBuffer buf = FloatBuffer.wrap(array, 2, 16); in testWrappedFloatBuffer_IllegalArg()
|
D | WrappedLongBufferTest.java | 39 long array[] = new long[20]; in testWrappedLongBuffer_IllegalArg() local 41 LongBuffer.wrap(array, -1, 0); in testWrappedLongBuffer_IllegalArg() 47 LongBuffer.wrap(array, 21, 0); in testWrappedLongBuffer_IllegalArg() 53 LongBuffer.wrap(array, 0, -1); in testWrappedLongBuffer_IllegalArg() 59 LongBuffer.wrap(array, 0, 21); in testWrappedLongBuffer_IllegalArg() 65 LongBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedLongBuffer_IllegalArg() 71 LongBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedLongBuffer_IllegalArg() 82 LongBuffer buf = LongBuffer.wrap(array, 2, 16); in testWrappedLongBuffer_IllegalArg()
|
D | WrappedDoubleBufferTest.java | 39 double array[] = new double[20]; in testWrappedDoubleuffer_IllegalArg() local 41 DoubleBuffer.wrap(array, -1, 0); in testWrappedDoubleuffer_IllegalArg() 47 DoubleBuffer.wrap(array, 21, 0); in testWrappedDoubleuffer_IllegalArg() 53 DoubleBuffer.wrap(array, 0, -1); in testWrappedDoubleuffer_IllegalArg() 59 DoubleBuffer.wrap(array, 0, 21); in testWrappedDoubleuffer_IllegalArg() 65 DoubleBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedDoubleuffer_IllegalArg() 71 DoubleBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedDoubleuffer_IllegalArg() 82 DoubleBuffer buf = DoubleBuffer.wrap(array, 2, 16); in testWrappedDoubleuffer_IllegalArg()
|
D | WrappedIntBufferTest.java | 39 int array[] = new int[20]; in testWrappedIntBuffer_IllegalArg() local 41 IntBuffer.wrap(array, -1, 0); in testWrappedIntBuffer_IllegalArg() 47 IntBuffer.wrap(array, 21, 0); in testWrappedIntBuffer_IllegalArg() 53 IntBuffer.wrap(array, 0, -1); in testWrappedIntBuffer_IllegalArg() 59 IntBuffer.wrap(array, 0, 21); in testWrappedIntBuffer_IllegalArg() 65 IntBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedIntBuffer_IllegalArg() 71 IntBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedIntBuffer_IllegalArg() 82 IntBuffer buf = IntBuffer.wrap(array, 2, 16); in testWrappedIntBuffer_IllegalArg()
|
/libcore/luni/src/test/java/libcore/dalvik/system/ |
D | VMRuntimeTest.java | 32 Object array = VMRuntime.getRuntime().newNonMovableArray(componentType, -1); in doTestNewNonMovableArray() local 38 … Object array = VMRuntime.getRuntime().newNonMovableArray(componentType, Integer.MIN_VALUE); in doTestNewNonMovableArray() local 45 Object array = VMRuntime.getRuntime().newNonMovableArray(componentType, i); in doTestNewNonMovableArray() local 46 assertTrue(array.getClass().isArray()); in doTestNewNonMovableArray() 47 assertEquals(array.getClass().getComponentType(), componentType); in doTestNewNonMovableArray() 48 assertEquals(Array.getLength(array), i); in doTestNewNonMovableArray() 55 Object array = VMRuntime.getRuntime().newNonMovableArray(null, 0); in testNewNonMovableArray() local 62 Object array = VMRuntime.getRuntime().newNonMovableArray(void.class, 0); in testNewNonMovableArray() local 86 Object array = VMRuntime.getRuntime().newUnpaddedArray(componentType, -1); in doTestNewUnpaddedArray() local 92 … Object array = VMRuntime.getRuntime().newUnpaddedArray(componentType, Integer.MIN_VALUE); in doTestNewUnpaddedArray() local [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/reflect/ |
D | OldAndroidArrayTest.java | 30 int[] array = (int[]) intArray; in testSingleInt() local 31 array[0] = 5; in testSingleInt() 35 assertEquals(6, array[1]); in testSingleInt() 38 array[2] = 27; in testSingleInt() 44 assertEquals(2, array.length); in testSingleInt() 45 assertEquals(Array.getLength(intArray), array.length); in testSingleInt() 61 String[] array = (String[]) strArray; in testSingle() local 62 array[0] = "entry zero"; in testSingle() 68 assertEquals("entry one", array[1]); in testSingle() 70 assertEquals(2, array.length); in testSingle() [all …]
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | DoublePrimitiveOpsTests.java | 47 double[] array = LongStream.range(1, 10).asDoubleStream().map(i -> i * 2).toArray(); in testToArray() local 48 assertEquals(array, new double[]{2, 4, 6, 8, 10, 12, 14, 16, 18}); in testToArray() 52 … double[] array = LongStream.range(1, 10).parallel().asDoubleStream().map(i -> i * 2).toArray(); in testToArray() local 53 assertEquals(array, new double[]{2, 4, 6, 8, 10, 12, 14, 16, 18}); in testToArray() 65 double[] array = Arrays.stream(content).sorted().toArray(); in testSort() local 66 assertEquals(array, sortedContent); in testSort() 70 double[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort() local 71 assertEquals(array, sortedContent); in testSort() 83 double[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort() local 84 assertEquals(array, sortedContent); in testSortSort() [all …]
|
/libcore/ojluni/annotations/sdk/nullability/java/lang/reflect/ |
D | Array.annotated.java | 40 public static int getLength(@libcore.util.NonNull java.lang.Object array) { throw new RuntimeExcept… in getLength() argument 42 …public static java.lang.Object get(@libcore.util.NonNull java.lang.Object array, int index) throws… in get() argument 44 public static boolean getBoolean(@libcore.util.NonNull java.lang.Object array, int index) throws ja… in getBoolean() argument 46 public static byte getByte(@libcore.util.NonNull java.lang.Object array, int index) throws java.lan… in getByte() argument 48 public static char getChar(@libcore.util.NonNull java.lang.Object array, int index) throws java.lan… in getChar() argument 50 public static short getShort(@libcore.util.NonNull java.lang.Object array, int index) throws java.l… in getShort() argument 52 public static int getInt(@libcore.util.NonNull java.lang.Object array, int index) throws java.lang.… in getInt() argument 54 public static long getLong(@libcore.util.NonNull java.lang.Object array, int index) throws java.lan… in getLong() argument 56 public static float getFloat(@libcore.util.NonNull java.lang.Object array, int index) throws java.l… in getFloat() argument 58 public static double getDouble(@libcore.util.NonNull java.lang.Object array, int index) throws java… in getDouble() argument [all …]
|