Home
last modified time | relevance | path

Searched refs:spliterator (Results 1 – 25 of 188) sorted by relevance

12345678

/libcore/ojluni/src/test/java/util/Arrays/
DStreamAndSpliterator.java75 assertThrowsNPE(() -> Arrays.spliterator((int[]) null, 0, 0)); in testSpliteratorNPEs()
76 assertThrowsNPE(() -> Arrays.spliterator((long[]) null, 0, 0)); in testSpliteratorNPEs()
77 assertThrowsNPE(() -> Arrays.spliterator((double[]) null, 0, 0)); in testSpliteratorNPEs()
78 assertThrowsNPE(() -> Arrays.spliterator((String[]) null, 0, 0)); in testSpliteratorNPEs()
84 assertThrowsAIOOB(() -> Arrays.spliterator(new int[]{}, 1, 0)); in testSpliteratorAIOBEs()
85 assertThrowsAIOOB(() -> Arrays.spliterator(new long[]{}, 1, 0)); in testSpliteratorAIOBEs()
86 assertThrowsAIOOB(() -> Arrays.spliterator(new double[]{}, 1, 0)); in testSpliteratorAIOBEs()
87 assertThrowsAIOOB(() -> Arrays.spliterator(new String[]{}, 1, 0)); in testSpliteratorAIOBEs()
90 assertThrowsAIOOB(() -> Arrays.spliterator(new int[]{}, -1, 0)); in testSpliteratorAIOBEs()
91 assertThrowsAIOOB(() -> Arrays.spliterator(new long[]{}, -1, 0)); in testSpliteratorAIOBEs()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DSpliteratorTester.java43 public static <T> void runBasicIterationTests(Spliterator<T> spliterator, in runBasicIterationTests() argument
49 boolean didAdvance = spliterator.tryAdvance(consumer); in runBasicIterationTests()
53 spliterator.forEachRemaining(consumer); in runBasicIterationTests()
57 assertFalse(spliterator.tryAdvance(consumer)); in runBasicIterationTests()
58 spliterator.forEachRemaining((T) -> fail()); in runBasicIterationTests()
61 public static <T> void runBasicIterationTests_unordered(Spliterator<T> spliterator, in runBasicIterationTests_unordered() argument
68 assertFalse(spliterator.tryAdvance(consumer)); in runBasicIterationTests_unordered()
70 assertTrue(spliterator.tryAdvance(consumer)); in runBasicIterationTests_unordered()
75 spliterator.forEachRemaining(consumer); in runBasicIterationTests_unordered()
81 assertFalse(spliterator.tryAdvance(consumer)); in runBasicIterationTests_unordered()
[all …]
DHashMapTest.java99 SpliteratorTester.runBasicIterationTests(keys.spliterator(), expectedKeys); in test_spliterator_keySet()
101 SpliteratorTester.testSpliteratorNPE(keys.spliterator()); in test_spliterator_keySet()
102 SpliteratorTester.runSizedTests(keys.spliterator(), 10); in test_spliterator_keySet()
104 keys.spliterator().characteristics()); in test_spliterator_keySet()
124 SpliteratorTester.runBasicIterationTests(values.spliterator(), expectedValues); in test_spliterator_values()
126 SpliteratorTester.testSpliteratorNPE(values.spliterator()); in test_spliterator_values()
128 assertEquals(Spliterator.SIZED, values.spliterator().characteristics()); in test_spliterator_values()
137 m.entrySet().spliterator().characteristics()); in test_spliterator_entrySet()
151 assertNull(m.entrySet().spliterator().trySplit()); in test_entrySet_subsizeEstimates()
153 assertEquals(0, m.entrySet().spliterator().estimateSize()); in test_entrySet_subsizeEstimates()
[all …]
DSpliteratorsTest.java108 Spliterator<String> sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
112 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
115 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
118 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
121 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
124 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
128 sp = Spliterators.spliterator(array, Spliterator.ORDERED); in testSpliteratorObjectArray()
137 Spliterator<String> sp = Spliterators.spliterator(array, 2, 10, 0); in testSpliteratorObjectArrayRange()
141 sp = Spliterators.spliterator(array, 2, 10, 0); in testSpliteratorObjectArrayRange()
144 sp = Spliterators.spliterator(array, 2, 10, 0); in testSpliteratorObjectArrayRange()
[all …]
DAbstractListTest.java72 Spliterator<Integer> spliterator = list.spliterator(); in spliterator_lateBinding() local
77 boolean didAdvance = spliterator.tryAdvance(value -> receivedValue.set(value)); in spliterator_lateBinding()
86 Spliterator<Integer> spliterator = list.spliterator(); in spliterator_modification_failFast() local
89 assertTrue(spliterator.tryAdvance(value -> {})); in spliterator_modification_failFast()
90 assertTrue(spliterator.tryAdvance(value -> {})); in spliterator_modification_failFast()
94 spliterator.tryAdvance(value -> receivedValue.set(value)); in spliterator_modification_failFast()
133 Supplier<Spliterator<Integer>> spliteratorSupplier = () -> listSupplier.get().spliterator(); in checkSpliteratorOfRandomAccessList()
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DTestData.java49 return Spliterators.iterator(spliterator()); in iterator()
52 Spliterator<T> spliterator(); in spliterator() method
55 return spliterator().hasCharacteristics(Spliterator.ORDERED); in isOrdered()
61 spliterator().forEachRemaining(target::add); in into()
81 Arrays::spliterator, a -> a.length); in ofArray()
86 Collection::spliterator, Collection::size); in ofCollection()
91 … b -> StreamSupport.stream(b.spliterator(), false), in ofSpinedBuffer()
92 … b -> StreamSupport.stream(b.spliterator(), true), in ofSpinedBuffer()
93 SpinedBuffer::spliterator, in ofSpinedBuffer()
101 s -> s.get().spliterator(), in ofSupplier()
[all …]
DStatefulTestOp.java47 Spliterator<P_IN> spliterator) { in chain() argument
48 return op.opEvaluateParallelLazy(helper, spliterator); in chain()
53 Spliterator<P_IN> spliterator, in chain() argument
55 return op.opEvaluateParallel(helper, spliterator, generator); in chain()
67 Spliterator<P_IN> spliterator) { in chain() argument
68 return op.opEvaluateParallelLazy(helper, spliterator); in chain()
73 Spliterator<P_IN> spliterator, in chain() argument
75 … return (Node<Integer>) op.opEvaluateParallel(helper, spliterator, generator); in chain()
87 Spliterator<P_IN> spliterator) { in chain()
88 return op.opEvaluateParallelLazy(helper, spliterator); in chain()
[all …]
DSpliteratorTestHelper.java153 Spliterator<T> spliterator = supplier.get(); in testSpliterator() local
155 spliterator.forEachRemaining(addToFromForEach); in testSpliterator()
202 S spliterator = supplier.get(); in testForEach() local
203 long sizeIfKnown = spliterator.getExactSizeIfKnown(); in testForEach()
204 boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); in testForEach()
207 spliterator = supplier.get(); in testForEach()
209 spliterator.forEachRemaining(addToFromForEach); in testForEach()
212 spliterator.forEachRemaining(boxingAdapter.apply( in testForEach()
215 spliterator.tryAdvance(boxingAdapter.apply( in testForEach()
232 S spliterator = supplier.get(); in testTryAdvance() local
[all …]
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DTestData.java48 return Spliterators.iterator(spliterator()); in iterator()
51 Spliterator<T> spliterator(); in spliterator() method
54 return spliterator().hasCharacteristics(Spliterator.ORDERED); in isOrdered()
60 spliterator().forEachRemaining(target::add); in into()
80 Arrays::spliterator, a -> a.length); in ofArray()
85 Collection::spliterator, Collection::size); in ofCollection()
90 … b -> StreamSupport.stream(b.spliterator(), false), in ofSpinedBuffer()
91 … b -> StreamSupport.stream(b.spliterator(), true), in ofSpinedBuffer()
92 SpinedBuffer::spliterator, in ofSpinedBuffer()
100 s -> s.get().spliterator(), in ofSupplier()
[all …]
DStatefulTestOp.java46 Spliterator<P_IN> spliterator) { in chain() argument
47 return op.opEvaluateParallelLazy(helper, spliterator); in chain()
52 Spliterator<P_IN> spliterator, in chain() argument
54 return op.opEvaluateParallel(helper, spliterator, generator); in chain()
66 Spliterator<P_IN> spliterator) { in chain() argument
67 return op.opEvaluateParallelLazy(helper, spliterator); in chain()
72 Spliterator<P_IN> spliterator, in chain() argument
74 … return (Node<Integer>) op.opEvaluateParallel(helper, spliterator, generator); in chain()
86 Spliterator<P_IN> spliterator) { in chain()
87 return op.opEvaluateParallelLazy(helper, spliterator); in chain()
[all …]
DSpliteratorTestHelper.java153 Spliterator<T> spliterator = supplier.get(); in testSpliterator() local
155 spliterator.forEachRemaining(addToFromForEach); in testSpliterator()
202 S spliterator = supplier.get(); in testForEach() local
203 long sizeIfKnown = spliterator.getExactSizeIfKnown(); in testForEach()
204 boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); in testForEach()
207 spliterator = supplier.get(); in testForEach()
209 spliterator.forEachRemaining(addToFromForEach); in testForEach()
212 spliterator.forEachRemaining(boxingAdapter.apply( in testForEach()
215 spliterator.tryAdvance(boxingAdapter.apply( in testForEach()
232 S spliterator = supplier.get(); in testTryAdvance() local
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DSliceOps.java130 …N> Spliterator<T> opEvaluateParallelLazy(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) { in makeRef() argument
131 long size = helper.exactOutputSizeIfKnown(spliterator); in makeRef()
132 if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in makeRef()
134 helper.wrapSpliterator(spliterator), in makeRef()
139 helper.wrapSpliterator(spliterator), in makeRef()
151 … return new SliceTask<>(this, helper, spliterator, Nodes.castingArray(), skip, limit). in makeRef()
152 invoke().spliterator(); in makeRef()
159 Spliterator<P_IN> spliterator, in makeRef() argument
161 long size = helper.exactOutputSizeIfKnown(spliterator); in makeRef()
162 if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in makeRef()
[all …]
DStreamSupport.java67 public static <T> Stream<T> stream(Spliterator<T> spliterator, boolean parallel) { in stream() argument
68 Objects.requireNonNull(spliterator); in stream()
69 return new ReferencePipeline.Head<>(spliterator, in stream()
70 StreamOpFlag.fromCharacteristics(spliterator), in stream()
137 public static IntStream intStream(Spliterator.OfInt spliterator, boolean parallel) { in intStream() argument
138 return new IntPipeline.Head<>(spliterator, in intStream()
139 StreamOpFlag.fromCharacteristics(spliterator), in intStream()
204 public static LongStream longStream(Spliterator.OfLong spliterator, in longStream() argument
206 return new LongPipeline.Head<>(spliterator, in longStream()
207 StreamOpFlag.fromCharacteristics(spliterator), in longStream()
[all …]
DNode.java71 Spliterator<T> spliterator(); in spliterator() method
125 Spliterator<T> spliterator = spliterator(); in truncate()
129 for (int i = 0; i < from && spliterator.tryAdvance(e -> { }); i++) { } in truncate()
131 spliterator.forEachRemaining(nodeBuilder); in truncate()
133 for (int i = 0; i < size && spliterator.tryAdvance(nodeBuilder); i++) { } in truncate()
241 T_SPLITR spliterator(); in spliterator() method
337 spliterator().forEachRemaining(consumer); in forEach()
365 Spliterator.OfInt spliterator = spliterator(); in truncate() local
368 for (int i = 0; i < from && spliterator.tryAdvance((IntConsumer) e -> { }); i++) { } in truncate()
370 spliterator.forEachRemaining((IntConsumer) nodeBuilder); in truncate()
[all …]
DForEachOps.java149 Spliterator<S> spliterator) { in evaluateSequential() argument
150 return helper.wrapAndCopyInto(this, spliterator).get(); in evaluateSequential()
155 Spliterator<S> spliterator) { in evaluateParallel() argument
157 new ForEachOrderedTask<>(helper, spliterator, this).invoke(); in evaluateParallel()
159 new ForEachTask<>(helper, spliterator, helper.wrapSink(this)).invoke(); in evaluateParallel()
254 private Spliterator<S> spliterator; field in ForEachOps.ForEachTask
260 Spliterator<S> spliterator, in ForEachTask() argument
265 this.spliterator = spliterator; in ForEachTask()
269 ForEachTask(ForEachTask<S, T> parent, Spliterator<S> spliterator) { in ForEachTask() argument
271 this.spliterator = spliterator; in ForEachTask()
[all …]
DAbstractPipeline.java347 public Spliterator<E_OUT> spliterator() { in spliterator() method in AbstractPipeline
403 Spliterator<?> spliterator = null; in sourceSpliterator() local
405 spliterator = sourceStage.sourceSpliterator; in sourceSpliterator()
409 spliterator = (Spliterator<?>) sourceStage.sourceSupplier.get(); in sourceSpliterator()
438 spliterator = p.opEvaluateParallelLazy(u, spliterator); in sourceSpliterator()
442 thisOpFlags = spliterator.hasCharacteristics(Spliterator.SIZED) in sourceSpliterator()
456 return spliterator; in sourceSpliterator()
472 final <P_IN> long exactOutputSizeIfKnown(Spliterator<P_IN> spliterator) { in exactOutputSizeIfKnown() argument
474 long size = StreamOpFlag.SIZED.isKnown(flags) ? spliterator.getExactSizeIfKnown() : -1; in exactOutputSizeIfKnown()
502 final <P_IN, S extends Sink<E_OUT>> S wrapAndCopyInto(S sink, Spliterator<P_IN> spliterator) { in wrapAndCopyInto() argument
[all …]
DNodes.java325 Spliterator<P_IN> spliterator, in collect() argument
328 long size = helper.exactOutputSizeIfKnown(spliterator); in collect()
329 if (size >= 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in collect()
333 new SizedCollectorTask.OfRef<>(spliterator, helper, array).invoke(); in collect()
336 Node<P_OUT> node = new CollectorTask.OfRef<>(helper, generator, spliterator).invoke(); in collect()
363 Spliterator<P_IN> spliterator, in collectInt() argument
365 long size = helper.exactOutputSizeIfKnown(spliterator); in collectInt()
366 if (size >= 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in collectInt()
370 new SizedCollectorTask.OfInt<>(spliterator, helper, array).invoke(); in collectInt()
374 Node.OfInt node = new CollectorTask.OfInt<>(helper, spliterator).invoke(); in collectInt()
[all …]
DWhileOps.java68 Spliterator<P_IN> spliterator) { in makeTakeWhileRef()
70 return opEvaluateParallel(helper, spliterator, Nodes.castingArray()) in makeTakeWhileRef()
71 .spliterator(); in makeTakeWhileRef()
75 helper.wrapSpliterator(spliterator), false, predicate); in makeTakeWhileRef()
82 Spliterator<P_IN> spliterator, in makeTakeWhileRef() argument
84 return new TakeWhileTask<>(this, helper, spliterator, generator) in makeTakeWhileRef()
128 Spliterator<P_IN> spliterator) {
130 return opEvaluateParallel(helper, spliterator, Integer[]::new)
131 .spliterator();
135 … (Spliterator.OfInt) helper.wrapSpliterator(spliterator), false, predicate);
[all …]
DAbstractTask.java101 protected Spliterator<P_IN> spliterator; field in AbstractTask
132 Spliterator<P_IN> spliterator) { in AbstractTask() argument
135 this.spliterator = spliterator; in AbstractTask()
147 Spliterator<P_IN> spliterator) { in AbstractTask() argument
149 this.spliterator = spliterator; in AbstractTask()
179 protected abstract K makeChild(Spliterator<P_IN> spliterator); in makeChild() argument
303 Spliterator<P_IN> rs = spliterator, ls; // right, left spliterators in compute()
341 spliterator = null; in onCompletion()
DPipelineHelper.java95 abstract<P_IN> long exactOutputSizeIfKnown(Spliterator<P_IN> spliterator); in exactOutputSizeIfKnown() argument
111 abstract<P_IN, S extends Sink<P_OUT>> S wrapAndCopyInto(S sink, Spliterator<P_IN> spliterator); in wrapAndCopyInto() argument
128 abstract<P_IN> void copyInto(Sink<P_IN> wrappedSink, Spliterator<P_IN> spliterator); in copyInto() argument
145 … abstract <P_IN> boolean copyIntoWithCancel(Sink<P_IN> wrappedSink, Spliterator<P_IN> spliterator); in copyIntoWithCancel() argument
167 abstract<P_IN> Spliterator<P_OUT> wrapSpliterator(Spliterator<P_IN> spliterator); in wrapSpliterator() argument
207 public abstract<P_IN> Node<P_OUT> evaluate(Spliterator<P_IN> spliterator, in evaluate() argument
DDistinctOps.java58 <P_IN> Node<T> reduce(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) { in makeRef()
64 return Nodes.node(reduceOp.evaluateParallel(helper, spliterator)); in makeRef()
70 Spliterator<P_IN> spliterator, in makeRef() argument
74 return helper.evaluate(spliterator, false, generator); in makeRef()
77 return reduce(helper, spliterator); in makeRef()
89 forEachOp.evaluateParallel(helper, spliterator); in makeRef()
105 …N> Spliterator<T> opEvaluateParallelLazy(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) { in makeRef() argument
108 return helper.wrapSpliterator(spliterator); in makeRef()
112 return reduce(helper, spliterator).spliterator(); in makeRef()
116 … return new StreamSpliterators.DistinctSpliterator<>(helper.wrapSpliterator(spliterator)); in makeRef()
DReduceOps.java254 Spliterator<P_IN> spliterator) {
255 long size = helper.exactOutputSizeIfKnown(spliterator);
258 return super.evaluateSequential(helper, spliterator);
263 Spliterator<P_IN> spliterator) {
264 long size = helper.exactOutputSizeIfKnown(spliterator);
267 return super.evaluateParallel(helper, spliterator);
430 Spliterator<P_IN> spliterator) {
431 long size = helper.exactOutputSizeIfKnown(spliterator);
434 return super.evaluateSequential(helper, spliterator);
439 Spliterator<P_IN> spliterator) {
[all …]
DMatchOps.java229 Spliterator<S> spliterator) { in evaluateSequential() argument
230 return helper.wrapAndCopyInto(sinkSupplier.get(), spliterator).getAndClearState(); in evaluateSequential()
235 Spliterator<S> spliterator) { in evaluateParallel() argument
242 return new MatchTask<>(this, helper, spliterator).invoke(); in evaluateParallel()
286 Spliterator<P_IN> spliterator) { in MatchTask() argument
287 super(helper, spliterator); in MatchTask()
294 MatchTask(MatchTask<P_IN, P_OUT> parent, Spliterator<P_IN> spliterator) { in MatchTask() argument
295 super(parent, spliterator); in MatchTask()
300 protected MatchTask<P_IN, P_OUT> makeChild(Spliterator<P_IN> spliterator) { in makeChild() argument
301 return new MatchTask<>(this, spliterator); in makeChild()
[all …]
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/
DSpliteratorTestHelper.java154 Spliterator<T> spliterator = supplier.get(); in testSpliterator() local
156 spliterator.forEachRemaining(addToFromForEach); in testSpliterator()
250 S spliterator = supplier.get(); in testForEach() local
251 long sizeIfKnown = spliterator.getExactSizeIfKnown(); in testForEach()
252 boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); in testForEach()
255 spliterator = supplier.get(); in testForEach()
257 spliterator.forEachRemaining(addToFromForEach); in testForEach()
260 spliterator.forEachRemaining(boxingAdapter.apply( in testForEach()
263 spliterator.tryAdvance(boxingAdapter.apply( in testForEach()
283 S spliterator = supplier.get(); in testTryAdvance() local
[all …]
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DSpinedBufferTest.java90 assertEquals(sb.count(), sb.spliterator().getExactSizeIfKnown()); in testSpliterator()
92 SpliteratorTestHelper.testSpliterator(sb::spliterator); in testSpliterator()
97 Spliterator<Integer> spliterator = sb.spliterator(); in testLastSplit() local
98 Spliterator<Integer> split = spliterator.trySplit(); in testLastSplit()
100 long lastSplitSize = spliterator.getExactSizeIfKnown(); in testLastSplit()
106 spliterator.forEachRemaining(contentOfLastSplit::add); in testLastSplit()
165 assertEquals(sb.count(), sb.spliterator().getExactSizeIfKnown()); in testIntSpliterator()
167 SpliteratorTestHelper.testIntSpliterator(sb::spliterator); in testIntSpliterator()
172 Spliterator.OfInt spliterator = sb.spliterator(); in testIntLastSplit() local
173 Spliterator.OfInt split = spliterator.trySplit(); in testIntLastSplit()
[all …]

12345678