Searched refs:array (Results 1 - 25 of 179) sorted by relevance

12345678

/libcore/ojluni/src/main/java/java/lang/reflect/
H A DArray.java48 * Creates a new array with the specified component type and
50 * Invoking this method is equivalent to creating an array
60 * component type of the new array
61 * @param length the length of the new array
62 * @return the new array
75 * Creates a new array
78 * represents a non-array class or interface, the new array
81 * {@code componentType} represents an array class, the
82 * number of dimensions of the new array i
129 getLength(Object array) argument
168 get(Object array, int index) argument
218 getBoolean(Object array, int index) argument
241 getByte(Object array, int index) argument
264 getChar(Object array, int index) argument
287 getShort(Object array, int index) argument
312 getInt(Object array, int index) argument
341 getLong(Object array, int index) argument
372 getFloat(Object array, int index) argument
405 getDouble(Object array, int index) argument
441 set(Object array, int index, Object value) argument
493 setBoolean(Object array, int index, boolean value) argument
519 setByte(Object array, int index, byte value) argument
555 setChar(Object array, int index, char value) argument
589 setShort(Object array, int index, short value) argument
623 setInt(Object array, int index, int value) argument
655 setLong(Object array, int index, long value) argument
685 setFloat(Object array, int index, float value) argument
713 setDouble(Object array, int index, double value) argument
773 badArray(Object array) argument
[all...]
/libcore/luni/src/test/java/libcore/java/util/
H A DOldAndroidArrayListTest.java30 ArrayList array = new ArrayList();
31 assertEquals(0, array.size());
32 assertTrue(array.isEmpty());
34 array.add(new Integer(0));
35 array.add(0, new Integer(1));
36 array.add(1, new Integer(2));
37 array.add(new Integer(3));
38 array.add(new Integer(1));
40 assertEquals(5, array.size());
41 assertFalse(array
[all...]
/libcore/json/src/test/java/org/json/
H A DJSONArrayTest.java31 JSONArray array = new JSONArray();
32 assertEquals(0, array.length());
33 assertEquals("", array.join(" AND "));
35 array.get(0);
40 array.getBoolean(0);
45 assertEquals("[]", array.toString());
46 assertEquals("[]", array.toString(4));
49 assertTrue(array.isNull(0));
50 assertNull(array.opt(0));
51 assertFalse(array
[all...]
/libcore/luni/src/main/java/libcore/reflect/
H A DListOfVariables.java23 final ArrayList<TypeVariable<?>> array = new ArrayList<TypeVariable<?>>(); field in class:ListOfVariables
26 array.add(elem);
30 TypeVariable<?>[] a = new TypeVariable[array.size()];
31 return array.toArray(a);
/libcore/benchmarks/src/benchmarks/
H A DDeepArrayOpsBenchmark.java27 private Object[] array; field in class:DeepArrayOpsBenchmark
34 array = new Object[arrayLength * 13];
37 array[i] = new IntWrapper(i);
40 array[i + 1] = new16ElementObjectarray();
43 array[i + 2] = new boolean[16];
46 array[i + 3] = new byte[16];
49 array[i + 4] = new char[16];
52 array[i + 5] = new short[16];
55 array[i + 6] = new float[16];
58 array[
[all...]
/libcore/support/src/test/java/tests/support/
H A DSupport_TestResource.java21 final String array[] = {"Str1", "Str2", "Str3"}; field in class:Support_TestResource
27 { "parent4", "parentValue4" }, {"IntegerVal", 1}, {"StringArray", array}};
H A DSupport_Proxy_I2.java22 int[] array(long[] f); method in interface:Support_Proxy_I2
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
H A DWrappedCharBufferTest1.java41 char array[] = new char[BUFFER_LENGTH];
43 CharBuffer.wrap(array, -1, 0);
49 CharBuffer.wrap(array, BUFFER_LENGTH + 1, 0);
55 CharBuffer.wrap(array, 0, -1);
61 CharBuffer.wrap(array, 0, BUFFER_LENGTH + 1);
67 CharBuffer.wrap(array, Integer.MAX_VALUE, 1);
73 CharBuffer.wrap(array, 1, Integer.MAX_VALUE);
H A DWrappedDoubleBufferTest.java39 double array[] = new double[20];
41 DoubleBuffer.wrap(array, -1, 0);
47 DoubleBuffer.wrap(array, 21, 0);
53 DoubleBuffer.wrap(array, 0, -1);
59 DoubleBuffer.wrap(array, 0, 21);
65 DoubleBuffer.wrap(array, Integer.MAX_VALUE, 1);
71 DoubleBuffer.wrap(array, 1, Integer.MAX_VALUE);
82 DoubleBuffer buf = DoubleBuffer.wrap(array, 2, 16);
H A DWrappedFloatBufferTest.java39 float array[] = new float[20];
41 FloatBuffer.wrap(array, -1, 0);
47 FloatBuffer.wrap(array, 21, 0);
53 FloatBuffer.wrap(array, 0, -1);
59 FloatBuffer.wrap(array, 0, 21);
65 FloatBuffer.wrap(array, Integer.MAX_VALUE, 1);
71 FloatBuffer.wrap(array, 1, Integer.MAX_VALUE);
82 FloatBuffer buf = FloatBuffer.wrap(array, 2, 16);
H A DWrappedIntBufferTest.java39 int array[] = new int[20];
41 IntBuffer.wrap(array, -1, 0);
47 IntBuffer.wrap(array, 21, 0);
53 IntBuffer.wrap(array, 0, -1);
59 IntBuffer.wrap(array, 0, 21);
65 IntBuffer.wrap(array, Integer.MAX_VALUE, 1);
71 IntBuffer.wrap(array, 1, Integer.MAX_VALUE);
82 IntBuffer buf = IntBuffer.wrap(array, 2, 16);
H A DWrappedLongBufferTest.java39 long array[] = new long[20];
41 LongBuffer.wrap(array, -1, 0);
47 LongBuffer.wrap(array, 21, 0);
53 LongBuffer.wrap(array, 0, -1);
59 LongBuffer.wrap(array, 0, 21);
65 LongBuffer.wrap(array, Integer.MAX_VALUE, 1);
71 LongBuffer.wrap(array, 1, Integer.MAX_VALUE);
82 LongBuffer buf = LongBuffer.wrap(array, 2, 16);
H A DWrappedShortBufferTest.java39 short array[] = new short[20];
41 ShortBuffer.wrap(array, -1, 0);
47 ShortBuffer.wrap(array, 21, 0);
53 ShortBuffer.wrap(array, 0, -1);
59 ShortBuffer.wrap(array, 0, 21);
65 ShortBuffer.wrap(array, Integer.MAX_VALUE, 1);
71 ShortBuffer.wrap(array, 1, Integer.MAX_VALUE);
82 ShortBuffer buf = ShortBuffer.wrap(array, 2, 16);
H A DWrappedByteBufferTest.java40 byte array[] = new byte[BUFFER_LENGTH];
42 ByteBuffer.wrap(array, -1, 0);
48 ByteBuffer.wrap(array, BUFFER_LENGTH + 1, 0);
54 ByteBuffer.wrap(array, 0, -1);
60 ByteBuffer.wrap(array, 0, BUFFER_LENGTH + 1);
66 ByteBuffer.wrap(array, 1, Integer.MAX_VALUE);
72 ByteBuffer.wrap(array, Integer.MAX_VALUE, 1);
H A DLongBufferTest.java51 long array[] = buf.array();
52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity());
54 loadTestData1(array, buf.arrayOffset(), buf.capacity());
55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity());
57 loadTestData2(array, buf.arrayOffset(), buf.capacity());
58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity());
61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity());
64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity());
68 long array[]
609 loadTestData1(long array[], int offset, int length) argument
615 loadTestData2(long array[], int offset, int length) argument
635 assertContentEquals(LongBuffer buf, long array[], int offset, int length) argument
[all...]
/libcore/luni/src/test/java/libcore/java/lang/reflect/
H A DOldAndroidArrayTest.java30 int[] array = (int[]) intArray;
31 array[0] = 5;
35 assertEquals(6, array[1]);
38 array[2] = 27;
44 assertEquals(2, array.length);
45 assertEquals(Array.getLength(intArray), array.length);
61 String[] array = (String[]) strArray;
62 array[0] = "entry zero";
65 //System.out.println("array: " + array);
[all...]
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
H A DDoubleNodeTest.java43 double[] array = new double[size];
44 for (int i = 0; i < array.length; i++) {
45 array[i] = i;
50 nodes.add(Nodes.node(array));
51 nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
52 nodes.add(tree(toList(array), l -> Nodes.node(toDoubleArray(l))));
53 nodes.add(fill(array, Nodes.doubleBuilder(array.length)));
54 nodes.add(fill(array, Nodes.doubleBuilder()));
57 params.add(new Object[]{array, nod
65 assertEqualsListDoubleArray(List<Double> list, double[] array) argument
90 fill(double[] array, Node.Builder.OfDouble nb) argument
124 testAsArray(double[] array, Node.OfDouble n) argument
129 testFlattenAsArray(double[] array, Node.OfDouble n) argument
134 testCopyTo(double[] array, Node.OfDouble n) argument
142 testForEach(double[] array, Node.OfDouble n) argument
152 testStreams(double[] array, Node.OfDouble n) argument
162 testSpliterator(double[] array, Node.OfDouble n) argument
167 testTruncate(double[] array, Node.OfDouble n) argument
[all...]
H A DIntNodeTest.java43 int[] array = new int[size];
44 for (int i = 0; i < array.length; i++) {
45 array[i] = i;
50 nodes.add(Nodes.node(array));
51 nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
52 nodes.add(tree(toList(array), l -> Nodes.node(toIntArray(l))));
53 nodes.add(fill(array, Nodes.intBuilder(array.length)));
54 nodes.add(fill(array, Nodes.intBuilder()));
57 params.add(new Object[]{array, nod
65 assertEqualsListIntArray(List<Integer> list, int[] array) argument
90 fill(int[] array, Node.Builder.OfInt nb) argument
124 testAsArray(int[] array, Node.OfInt n) argument
129 testFlattenAsArray(int[] array, Node.OfInt n) argument
134 testCopyTo(int[] array, Node.OfInt n) argument
142 testForEach(int[] array, Node.OfInt n) argument
152 testStreams(int[] array, Node.OfInt n) argument
160 testSpliterator(int[] array, Node.OfInt n) argument
165 testTruncate(int[] array, Node.OfInt n) argument
[all...]
H A DLongNodeTest.java43 long[] array = new long[size];
44 for (int i = 0; i < array.length; i++) {
45 array[i] = i;
50 nodes.add(Nodes.node(array));
51 nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
52 nodes.add(tree(toList(array), l -> Nodes.node(toLongArray(l))));
53 nodes.add(fill(array, Nodes.longBuilder(array.length)));
54 nodes.add(fill(array, Nodes.longBuilder()));
57 params.add(new Object[]{array, nod
65 assertEqualsListLongArray(List<Long> list, long[] array) argument
90 fill(long[] array, Node.Builder.OfLong nb) argument
124 testAsArray(long[] array, Node.OfLong n) argument
129 testFlattenAsArray(long[] array, Node.OfLong n) argument
134 testCopyTo(long[] array, Node.OfLong n) argument
142 testForEach(long[] array, Node.OfLong n) argument
152 testStreams(long[] array, Node.OfLong n) argument
161 testSpliterator(long[] array, Node.OfLong n) argument
166 testTruncate(long[] array, Node.OfLong n) argument
[all...]
H A DNodeTest.java43 Integer[] array = new Integer[size];
44 for (int i = 0; i < array.length; i++) {
45 array[i] = i;
49 nodes.add(Nodes.node(array));
50 nodes.add(Nodes.node(Arrays.asList(array)));
51 nodes.add(degenerateTree(Arrays.asList(array).iterator()));
52 nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l.toArray(new Integer[l.size()]))));
53 nodes.add(tree(Arrays.asList(array), l -> Nodes.node(l)));
54 nodes.add(fill(array, Nodes.builder(array
66 fill(Integer[] array, Node.Builder<Integer> nb) argument
101 testAsArray(Integer[] array, Node<Integer> n) argument
106 testFlattenAsArray(Integer[] array, Node<Integer> n) argument
112 testCopyTo(Integer[] array, Node<Integer> n) argument
120 testForEach(Integer[] array, Node<Integer> n) argument
128 testStreams(Integer[] array, Node<Integer> n) argument
137 testSpliterator(Integer[] array, Node<Integer> n) argument
142 testTruncate(Integer[] array, Node<Integer> n) argument
[all...]
H A DSpinedBufferTest.java65 int[] array = IntStream.range(0, size).toArray();
68 Arrays.stream(array).boxed().forEach(sb);
69 params.add(new Object[]{array, sb});
72 Arrays.stream(array).boxed().forEach(sb);
73 params.add(new Object[]{array, sb});
76 Arrays.stream(array).boxed().forEach(sb);
77 params.add(new Object[]{array, sb});
80 Arrays.stream(array).boxed().forEach(sb);
81 params.add(new Object[]{array, sb});
88 public void testSpliterator(int[] array, SpinedBuffe argument
96 testLastSplit(int[] array, SpinedBuffer<Integer> sb) argument
163 testIntSpliterator(int[] array, SpinedBuffer.OfInt sb) argument
171 testIntLastSplit(int[] array, SpinedBuffer.OfInt sb) argument
238 testLongSpliterator(long[] array, SpinedBuffer.OfLong sb) argument
246 testLongLastSplit(long[] array, SpinedBuffer.OfLong sb) argument
314 testDoubleSpliterator(double[] array, SpinedBuffer.OfDouble sb) argument
322 testLongLastSplit(double[] array, SpinedBuffer.OfDouble sb) argument
[all...]
/libcore/luni/src/test/java/libcore/javax/net/ssl/
H A DSSLServerSocketTest.java42 String[] array = new String[] {socket.getEnabledCipherSuites()[0]};
43 String originalFirstElement = array[0];
44 socket.setEnabledCipherSuites(array);
45 array[0] = "Modified after having been set";
60 String[] array = new String[] {socket.getEnabledProtocols()[0]};
61 String originalFirstElement = array[0];
62 socket.setEnabledProtocols(array);
63 array[0] = "Modified after having been set";
/libcore/ojluni/src/main/java/java/util/stream/
H A DNodes.java59 * The maximum size of an array that can be allocated.
64 static final String BAD_SIZE = "Stream size exceeds max array size";
131 * Produces a {@link Node} describing an array.
133 * <p>The node will hold a reference to the array and will not make a copy.
136 * @param array the array
137 * @return a node holding an array
139 static <T> Node<T> node(T[] array) { argument
140 return new ArrayNode<>(array);
162 * @param generator the array factor
192 node(int[] array) argument
229 node(final long[] array) argument
266 node(final double[] array) argument
565 copyInto(T_ARR array, int offset) argument
639 final T[] array; field in class:Nodes.ArrayNode
650 ArrayNode(T[] array) argument
713 copyInto(T[] array, int offset) argument
792 copyInto(T[] array, int offset) argument
857 copyInto(T_ARR array, int offset) argument
1288 copyInto(T[] array, int offset) argument
1313 final int[] array; field in class:Nodes.IntArrayNode
1323 IntArrayNode(int[] array) argument
1369 final long[] array; field in class:Nodes.LongArrayNode
1379 LongArrayNode(long[] array) argument
1423 final double[] array; field in class:Nodes.DoubleArrayNode
1433 DoubleArrayNode(double[] array) argument
1680 copyInto(int[] array, int offset) argument
1740 copyInto(long[] array, int offset) argument
1800 copyInto(double[] array, int offset) argument
1899 private final P_OUT[] array; field in class:Nodes.SizedCollectorTask.OfRef
1901 OfRef(Spliterator<P_IN> spliterator, PipelineHelper<P_OUT> helper, P_OUT[] array) argument
1931 private final int[] array; field in class:Nodes.SizedCollectorTask.OfInt
1933 OfInt(Spliterator<P_IN> spliterator, PipelineHelper<Integer> helper, int[] array) argument
1963 private final long[] array; field in class:Nodes.SizedCollectorTask.OfLong
1965 OfLong(Spliterator<P_IN> spliterator, PipelineHelper<Long> helper, long[] array) argument
1995 private final double[] array; field in class:Nodes.SizedCollectorTask.OfDouble
1997 OfDouble(Spliterator<P_IN> spliterator, PipelineHelper<Double> helper, double[] array) argument
2073 private final T[] array; field in class:Nodes.ToArrayTask.OfRef
2075 OfRef(Node<T> node, T[] array, int offset) argument
2101 private final T_ARR array; field in class:Nodes.ToArrayTask.OfPrimitive
2103 OfPrimitive(T_NODE node, T_ARR array, int offset) argument
2127 OfInt(Node.OfInt node, int[] array, int offset) argument
2135 OfLong(Node.OfLong node, long[] array, int offset) argument
2143 OfDouble(Node.OfDouble node, double[] array, int offset) argument
[all...]
/libcore/luni/src/main/java/java/util/concurrent/
H A DPriorityBlockingQueue.java85 * The implementation uses an array-based binary heap, with public
101 * Default array capacity.
106 * The maximum size of array to allocate.
107 * Some VMs reserve some header words in an array.
109 * OutOfMemoryError: Requested array size exceeds VM limit
251 * Tries to grow array to accommodate at least one more element
256 * @param array the heap array
257 * @param oldCap the length of the array
259 private void tryGrow(Object[] array, in argument
326 siftUpComparable(int k, T x, Object[] array) argument
339 siftUpUsingComparator(int k, T x, Object[] array, Comparator<? super T> cmp) argument
362 siftDownComparable(int k, T x, Object[] array, int n) argument
383 siftDownUsingComparator(int k, T x, Object[] array, int n, Comparator<? super T> cmp) argument
833 final Object[] array; // Array of all elements field in class:PriorityBlockingQueue.Itr
837 Itr(Object[] array) argument
908 Object[] array; field in class:PriorityBlockingQueue.PBQSpliterator
912 PBQSpliterator(PriorityBlockingQueue<E> queue, Object[] array, int index, int fence) argument
[all...]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
H A DDoublePrimitiveOpsTests.java47 double[] array = LongStream.range(1, 10).asDoubleStream().map(i -> i * 2).toArray();
48 assertEquals(array, new double[]{2, 4, 6, 8, 10, 12, 14, 16, 18});
52 double[] array = LongStream.range(1, 10).parallel().asDoubleStream().map(i -> i * 2).toArray();
53 assertEquals(array, new double[]{2, 4, 6, 8, 10, 12, 14, 16, 18});
65 double[] array = Arrays.stream(content).sorted().toArray();
66 assertEquals(array, sortedContent);
70 double[] array = Arrays.stream(content).parallel().sorted().toArray();
71 assertEquals(array, sortedContent);
83 double[] array = Arrays.stream(content).sorted().sorted().toArray();
84 assertEquals(array, sortedConten
[all...]

Completed in 360 milliseconds

12345678