Home
last modified time | relevance | path

Searched refs:toArray (Results 1 – 25 of 410) sorted by relevance

12345678910>>...17

/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DIntSliceOpTest.java76 … exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(0), IntStream.range(1, 2).toArray()); in testSkip()
77 exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(1), EMPTY_INT_ARRAY); in testSkip()
78 … exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0), IntStream.range(1, 101).toArray()); in testSkip()
79 …exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10), IntStream.range(11, 101).toArray()… in testSkip()
80 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100), EMPTY_INT_ARRAY); in testSkip()
81 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200), EMPTY_INT_ARRAY); in testSkip()
98 exerciseOps(IntStream.range(1, 2).toArray(), s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit()
99 … exerciseOps(IntStream.range(1, 2).toArray(), s -> s.limit(1), IntStream.range(1, 2).toArray()); in testLimit()
100 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit()
101 …exerciseOps(IntStream.range(1, 101).toArray(), s -> s.limit(10), IntStream.range(1, 11).toArray()); in testLimit()
[all …]
DDoublePrimitiveOpsTests.java62 double[] array = LongStream.range(1, 10).asDoubleStream().map(i -> i * 2).toArray(); in testToArray()
67 … double[] array = LongStream.range(1, 10).parallel().asDoubleStream().map(i -> i * 2).toArray(); in testToArray()
75 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray(); in testSort()
80 double[] array = Arrays.stream(content).sorted().toArray(); in testSort()
85 double[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
92 double[] range = LongStream.range(0, 10).asDoubleStream().toArray(); in testSortDistinct()
94 … assertEquals(LongStream.range(0, 10).asDoubleStream().sorted().distinct().toArray(), range); in testSortDistinct()
95 …rtEquals(LongStream.range(0, 10).asDoubleStream().parallel().sorted().distinct().toArray(), range); in testSortDistinct()
101 assertEquals(DoubleStream.of(data).sorted().distinct().toArray(), expected); in testSortDistinct()
102 assertEquals(DoubleStream.of(data).parallel().sorted().distinct().toArray(), expected); in testSortDistinct()
[all …]
DIntPrimitiveOpsTests.java121 int[] array = IntStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray()
126 int[] array = IntStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray()
134 int[] content = IntStream.generate(() -> r.nextInt(100)).limit(10).toArray(); in testSort()
139 int[] array = Arrays.stream(content).sorted().toArray(); in testSort()
144 int[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
151 int[] range = IntStream.range(0, 10).toArray(); in testSortDistinct()
153 assertEquals(IntStream.range(0, 10).sorted().distinct().toArray(), range); in testSortDistinct()
154 assertEquals(IntStream.range(0, 10).parallel().sorted().distinct().toArray(), range); in testSortDistinct()
158 assertEquals(IntStream.of(data).sorted().distinct().toArray(), expected); in testSortDistinct()
159 assertEquals(IntStream.of(data).parallel().sorted().distinct().toArray(), expected); in testSortDistinct()
[all …]
DLongPrimitiveOpsTests.java114 long[] array = LongStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray()
119 long[] array = LongStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray()
127 long[] content = LongStream.generate(() -> r.nextLong()).limit(10).toArray(); in testSort()
132 long[] array = Arrays.stream(content).sorted().toArray(); in testSort()
137 long[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
144 long[] range = LongStream.range(0, 10).toArray(); in testSortDistinct()
146 assertEquals(LongStream.range(0, 10).sorted().distinct().toArray(), range); in testSortDistinct()
147 assertEquals(LongStream.range(0, 10).parallel().sorted().distinct().toArray(), range); in testSortDistinct()
151 assertEquals(LongStream.of(data).sorted().distinct().toArray(), expected); in testSortDistinct()
152 assertEquals(LongStream.of(data).parallel().sorted().distinct().toArray(), expected); in testSortDistinct()
[all …]
DToArrayOpTest.java57 assertCountSum(Arrays.asList(countTo(0).stream().toArray()), 0, 0); in testToArray()
58 assertCountSum(Arrays.asList(countTo(10).stream().toArray()), 10, 55); in testToArray()
63 exerciseTerminalOps(data, s -> s.toArray()); in testOps()
71 …Object[] objects = exerciseTerminalOps(data, s -> s.map(i -> (Integer) (i + i)), s -> s.toArray()); in testOpsWithMap()
80 Object[] objects = exerciseTerminalOps(data, s -> s.sorted(), s -> s.toArray()); in testOpsWithSorted()
91 s -> s.toArray()); in testOpsWithFlatMap()
100 exerciseTerminalOps(data, s -> s.filter(LambdaTestHelpers.pEven), s -> s.toArray()); in testOpsWithFilter()
110 s -> s.toArray(Integer[]::new)); in testAsArrayWithType()
125 exerciseTerminalOps(data, f, s -> s.toArray()); in testDistinctAndSortedPermutations()
127 Integer[] is = exerciseTerminalOps(data, f, s -> s.toArray(Integer[]::new)); in testDistinctAndSortedPermutations()
[all …]
/libcore/luni/src/test/java/libcore/java/util/stream/
DMapMultiTest.java67 int[] result = Stream.of(10, 20, 30).mapMultiToInt(intToId).toArray(); in testMapMultiToInt_toId()
74 long[] result = Stream.of(10L, 20L, 30L).mapMultiToLong(longToId).toArray(); in testMapMultiToLong_toId()
81 double[] result = Stream.of(10.0, 20.0, 30.0).mapMultiToDouble(doubleToId).toArray(); in testMapMultiToDouble_toId()
88 int[] result = Stream.of(10, 20, 30).mapMultiToInt(intDevNull).toArray(); in testMapMultiToInt_noopSink()
95 long[] result = Stream.of(10L, 20L, 30L).mapMultiToLong(longDevNull).toArray(); in testMapMultiToLong_noopSink()
102 double[] result = Stream.of(10.0, 20.0, 30.0).mapMultiToDouble(doubleDevNull).toArray(); in testMapMultiToDouble_noopSink()
109 int[] flattened = Stream.of(List.of(10, 20, 30)).mapMultiToInt(intListFlattener).toArray(); in testMapMultiToInt_flattenToList()
117 Stream.of(List.of(10L, 20L, 30L)).mapMultiToLong(longListFlattener).toArray(); in testMapMultiToLong_flattenToList()
127 .toArray(); in testMapMultiToDouble_flattenToList()
DStreamTest.java52 String[] array = Stream.of(object).toArray(String[]::new); in streamOfSingleObject()
64 .toArray(String[]::new); in streamOfObjects()
77 assertArrayEquals(new Integer[] {10}, Stream.ofNullable(10).toArray()); in ofNullable_ofNonNull()
/libcore/luni/src/test/java/libcore/java/lang/
DStringBufferTest.java31 assertTrue(Arrays.equals(expected, s.chars().toArray())); in testChars()
36 assertTrue(Arrays.equals(new int[]{high, low, low}, surrogateCP.chars().toArray())); in testChars()
45 assertTrue(Arrays.equals(expected, s.codePoints().toArray())); in testCodePoints()
50 assertEquals(Character.toCodePoint(high, low), surrogateCP.codePoints().toArray()[0]); in testCodePoints()
51 assertEquals((int) low, surrogateCP.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints()
52 assertEquals((int) '0', surrogateCP.codePoints().toArray()[2]); in testCodePoints()
DStringBuilderTest.java141 assertTrue(Arrays.equals(expected, s.chars().toArray())); in testChars()
146 assertTrue(Arrays.equals(new int[]{high, low, low}, surrogateCP.chars().toArray())); in testChars()
155 assertTrue(Arrays.equals(expected, s.codePoints().toArray())); in testCodePoints()
160 assertEquals(Character.toCodePoint(high, low), surrogateCP.codePoints().toArray()[0]); in testCodePoints()
161 assertEquals((int) low, surrogateCP.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints()
162 assertEquals((int) '0', surrogateCP.codePoints().toArray()[2]); in testCodePoints()
/libcore/ojluni/src/test/java/util/BitSet/stream/
DBitSetStreamTest.java146 { "none", IntStream.empty().toArray() }, in spliteratorOfIntDataProvider()
147 { "index 0", IntStream.of(0).toArray() }, in spliteratorOfIntDataProvider()
148 { "index 255", IntStream.of(255).toArray() }, in spliteratorOfIntDataProvider()
149 { "index 0 and 255", IntStream.of(0, 255).toArray() }, in spliteratorOfIntDataProvider()
154 { "every bit", IntStream.range(0, 255).toArray() }, in spliteratorOfIntDataProvider()
155 { "step 2", IntStream.range(0, 255).map(f -> f * 2).toArray() }, in spliteratorOfIntDataProvider()
156 { "step 3", IntStream.range(0, 255).map(f -> f * 3).toArray() }, in spliteratorOfIntDataProvider()
157 { "step 5", IntStream.range(0, 255).map(f -> f * 5).toArray() }, in spliteratorOfIntDataProvider()
158 { "step 7", IntStream.range(0, 255).map(f -> f * 7).toArray() }, in spliteratorOfIntDataProvider()
159 { "1, 10, 100, 1000", IntStream.of(1, 10, 100, 1000).toArray() }, in spliteratorOfIntDataProvider()
[all …]
/libcore/ojluni/src/test/java/util/IdentityHashMap/
DToArray.java63 Object[] mArray = m.entrySet().toArray(); in main()
76 if (es.toArray().length != 0) in main()
78 if (es.toArray(new Object[]{Boolean.TRUE})[0] != null) in main()
81 if (es.toArray().length != 1) in main()
83 Object[] x = es.toArray(new Object[]{Boolean.TRUE, Boolean.TRUE}); in main()
/libcore/luni/src/test/java/libcore/java/util/
DRandomTest.java76 int[] streamRands = new Random(0).ints().limit(limit).toArray(); in test_ints$()
90 int[] streamRands = new Random(0).ints(size).toArray(); in test_ints$L()
112 int[] streamRands = new Random(0).ints(origin, bound).limit(limit).toArray(); in test_ints$II()
133 int[] streamRands = new Random(0).ints(size, origin, bound).toArray(); in test_ints$LII()
157 long[] streamRands = new Random(0).longs().limit(limit).toArray(); in test_longs$()
171 long[] streamRands = new Random(0).longs(size).toArray(); in test_longs$L()
192 long[] streamRands = new Random(0).longs(origin, bound).limit(limit).toArray(); in test_longs$II()
212 long[] streamRands = new Random(0).longs(size, origin, bound).toArray(); in test_longs$LII()
236 double[] streamRands = new Random(0).doubles().limit(limit).toArray(); in test_doubles$()
250 double[] streamRands = new Random(0).doubles(size).toArray(); in test_doubles$L()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/
DCharBufferTest.java36 assertTrue(Arrays.equals(expected, cb.chars().limit(s.length()).toArray())); in testChars()
46 assertTrue(Arrays.equals(expected, cb.codePoints().limit(s.length()).toArray())); in testCodePoints()
53 assertEquals(Character.toCodePoint(high, low), cb.codePoints().toArray()[0]); in testCodePoints()
54 assertEquals((int) low, cb.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints()
55 assertEquals((int) '0', cb.codePoints().toArray()[2]); in testCodePoints()
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DSliceSpliteratorTest.java77 … Spliterator<Integer> s = Arrays.spliterator(source.stream().toArray(Integer[]::new)); in sliceSpliteratorDataProvider()
90 … Spliterator.OfInt s = Arrays.spliterator(source.stream().mapToInt(i->i).toArray()); in sliceSpliteratorDataProvider()
103 … Spliterator.OfLong s = Arrays.spliterator(source.stream().mapToLong(i->i).toArray()); in sliceSpliteratorDataProvider()
116 … Spliterator.OfDouble s = Arrays.spliterator(source.stream().mapToDouble(i->i).toArray()); in sliceSpliteratorDataProvider()
133 … Spliterator<Integer> s = Arrays.spliterator(source.stream().toArray(Integer[]::new)); in sliceSpliteratorDataProvider()
147 … Spliterator.OfInt s = Arrays.spliterator(source.stream().mapToInt(i->i).toArray()); in sliceSpliteratorDataProvider()
161 … Spliterator.OfLong s = Arrays.spliterator(source.stream().mapToLong(i->i).toArray()); in sliceSpliteratorDataProvider()
175 … Spliterator.OfDouble s = Arrays.spliterator(LongStream.range(0, SIZE).asDoubleStream().toArray()); in sliceSpliteratorDataProvider()
183 return data.toArray(new Object[0][]); in sliceSpliteratorDataProvider()
DFlagOpTest.java110 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsClearAllSet()
112 FlagDeclaringOp[] opsArray = ops.toArray(new FlagDeclaringOp[ops.size()]); in testFlagsClearAllSet()
149 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsSetAllClear()
151 FlagDeclaringOp[] opsArray = ops.toArray(new FlagDeclaringOp[ops.size()]); in testFlagsSetAllClear()
183 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsSetSequence()
185 IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]); in testFlagsSetSequence()
219 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsClearSequence()
221 IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]); in testFlagsClearSequence()
245 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsSizedOrderedParallelCollect()
247 IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]); in testFlagsSizedOrderedParallelCollect()
/libcore/ojluni/src/main/java/java/util/
DCollection.java322 Object[] toArray(); in toArray() method
375 <T> T[] toArray(T[] a); in toArray() method
412 default <T> T[] toArray(IntFunction<T[]> generator) { in toArray() method
413 return toArray(generator.apply(0)); in toArray()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DAbstractCollectionTest.java247 Object[] array = ac.toArray(); in test_toArray()
288 ac.toArray((Object[]) null); in test_toArray$Ljava_lang_Object()
295 ac.toArray(new StringBuffer[ac.size()]); in test_toArray$Ljava_lang_Object()
302 assertSame(a, ac.toArray(a)); in test_toArray$Ljava_lang_Object()
305 assertNotSame(a, ac.toArray(a)); in test_toArray$Ljava_lang_Object()
306 a = ac.toArray(a); in test_toArray$Ljava_lang_Object()
310 ac.toArray(csa); in test_toArray$Ljava_lang_Object()
/libcore/ojluni/src/test/java/util/SequencedCollection/
DSimpleSortedSet.java108 public Object[] toArray() { in toArray() method in SimpleSortedSet
109 return set.toArray(); in toArray()
112 public <T> T[] toArray(T[] a) { in toArray() method in SimpleSortedSet
113 return set.toArray(a); in toArray()
DSimpleList.java105 public Object[] toArray() { in toArray() method in SimpleList
106 return list.toArray(); in toArray()
109 public <T> T[] toArray(T[] a) { in toArray() method in SimpleList
110 return list.toArray(a); in toArray()
DSimpleDeque.java105 public Object[] toArray() { in toArray() method in SimpleDeque
106 return deque.toArray(); in toArray()
109 public <T> T[] toArray(T[] a) { in toArray() method in SimpleDeque
110 return deque.toArray(a); in toArray()
/libcore/support/src/test/java/tests/support/
DSupport_MapTest.java135 T[] set1TypedArray1 = set1.toArray(zeroLengthArray); in crossCheckOrdering()
159 T[] set1TypedArray2 = set1.toArray(parameterArray1); in crossCheckOrdering()
164 Object[] set1UntypedArray = set1.toArray(); in crossCheckOrdering()
169 T[] set2TypedArray1 = set2.toArray(zeroLengthArray); in crossCheckOrdering()
175 T[] set2TypedArray2 = set1.toArray(parameterArray2); in crossCheckOrdering()
180 Object[] set2UntypedArray = set2.toArray(); in crossCheckOrdering()
/libcore/jsr166-tests/src/test/java/jsr166/
DCopyOnWriteArraySetTest.java312 Object[] a = new CopyOnWriteArraySet().toArray(); in testToArray()
322 assertTrue(Arrays.equals(elements, full.toArray())); in testToArray()
323 assertSame(Object[].class, full.toArray().getClass()); in testToArray()
335 assertSame(a, empty.toArray(a)); in testToArray2()
339 assertSame(a, empty.toArray(a)); in testToArray2()
351 assertTrue(Arrays.equals(elements, full.toArray(a))); in testToArray2()
354 assertSame(Integer[].class, full.toArray(a).getClass()); in testToArray2()
358 assertSame(a, full.toArray(a)); in testToArray2()
363 assertSame(a, full.toArray(a)); in testToArray2()
379 c.toArray(new Long[5]); in testToArray_ArrayStoreException()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DCopyOnWriteArraySetTest.java334 Object[] a = new CopyOnWriteArraySet().toArray(); in testToArray()
344 assertTrue(Arrays.equals(elements, full.toArray())); in testToArray()
345 assertSame(Object[].class, full.toArray().getClass()); in testToArray()
357 assertSame(a, empty.toArray(a)); in testToArray2()
361 assertSame(a, empty.toArray(a)); in testToArray2()
373 assertTrue(Arrays.equals(elements, full.toArray(a))); in testToArray2()
376 assertSame(Integer[].class, full.toArray(a).getClass()); in testToArray2()
380 assertSame(a, full.toArray(a)); in testToArray2()
385 assertSame(a, full.toArray(a)); in testToArray2()
401 c.toArray(new Long[5]); in testToArray_ArrayStoreException()
[all …]
/libcore/ojluni/src/test/java/util/HashMap/
DToArray.java69 T[] res = collection.toArray(inputArray); in checkToTypedArray()
106 Object[] objects = collection.toArray(); in checkToObjectArray()
130 checkToArray(i + "-keys", keys.toArray(new String[0]), map.keySet(), !ordered); in checkMap()
131 checkToArray(i + "-values", values.toArray(new String[0]), map.values(), !ordered); in checkMap()
150 … checkToArray("100", LongStream.range(0, 100).boxed().toArray(Long[]::new), longSet, !ordered); in checkSet()
157 .toArray(Long[]::new), longSet, !ordered); in checkSet()
/libcore/ojluni/src/test/java/util/EnumMap/
DToArray.java46 Object[] z = m.entrySet().toArray(); in testToArray()
52 Map.Entry[] x2 = m.entrySet().toArray(x1); in testToArray()
59 Map.Entry[] y2 = m.entrySet().toArray(y1); in testToArray()

12345678910>>...17