Home
last modified time | relevance | path

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

1234567

/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.java104 Spliterator<String> sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
108 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
111 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
114 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
117 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
120 sp = Spliterators.spliterator(array, 0); in testSpliteratorObjectArray()
124 sp = Spliterators.spliterator(array, Spliterator.ORDERED); in testSpliteratorObjectArray()
133 Spliterator<String> sp = Spliterators.spliterator(array, 2, 10, 0); in testSpliteratorObjectArrayRange()
137 sp = Spliterators.spliterator(array, 2, 10, 0); in testSpliteratorObjectArrayRange()
140 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/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/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/main/java/java/util/stream/
DSliceOps.java134 …N> Spliterator<T> opEvaluateParallelLazy(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) { in makeRef() argument
135 long size = helper.exactOutputSizeIfKnown(spliterator); in makeRef()
136 if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in makeRef()
138 helper.wrapSpliterator(spliterator), in makeRef()
143 helper.wrapSpliterator(spliterator), in makeRef()
155 return new SliceTask<>(this, helper, spliterator, castingArray(), skip, limit). in makeRef()
156 invoke().spliterator(); in makeRef()
163 Spliterator<P_IN> spliterator, in makeRef() argument
165 long size = helper.exactOutputSizeIfKnown(spliterator); in makeRef()
166 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 …]
DForEachOps.java150 Spliterator<S> spliterator) { in evaluateSequential() argument
151 return helper.wrapAndCopyInto(this, spliterator).get(); in evaluateSequential()
156 Spliterator<S> spliterator) { in evaluateParallel() argument
158 new ForEachOrderedTask<>(helper, spliterator, this).invoke(); in evaluateParallel()
160 new ForEachTask<>(helper, spliterator, helper.wrapSink(this)).invoke(); in evaluateParallel()
255 private Spliterator<S> spliterator; field in ForEachOps.ForEachTask
261 Spliterator<S> spliterator, in ForEachTask() argument
266 this.spliterator = spliterator; in ForEachTask()
270 ForEachTask(ForEachTask<S, T> parent, Spliterator<S> spliterator) { in ForEachTask() argument
272 this.spliterator = spliterator; in ForEachTask()
[all …]
DAbstractPipeline.java344 public Spliterator<E_OUT> spliterator() { in spliterator() method in AbstractPipeline
400 Spliterator<?> spliterator = null; in sourceSpliterator() local
402 spliterator = sourceStage.sourceSpliterator; in sourceSpliterator()
406 spliterator = (Spliterator<?>) sourceStage.sourceSupplier.get(); in sourceSpliterator()
435 spliterator = p.opEvaluateParallelLazy(u, spliterator); in sourceSpliterator()
439 thisOpFlags = spliterator.hasCharacteristics(Spliterator.SIZED) in sourceSpliterator()
453 return spliterator; in sourceSpliterator()
469 final <P_IN> long exactOutputSizeIfKnown(Spliterator<P_IN> spliterator) { in exactOutputSizeIfKnown() argument
470 … return StreamOpFlag.SIZED.isKnown(getStreamAndOpFlags()) ? spliterator.getExactSizeIfKnown() : -1; in exactOutputSizeIfKnown()
474 final <P_IN, S extends Sink<E_OUT>> S wrapAndCopyInto(S sink, Spliterator<P_IN> spliterator) { in wrapAndCopyInto() argument
[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()
130 for (int i = 0; (i < size) && spliterator.tryAdvance(nodeBuilder); i++) { } in truncate()
237 T_SPLITR spliterator(); in spliterator() method
333 spliterator().forEachRemaining(consumer); in forEach()
361 Spliterator.OfInt spliterator = spliterator(); in truncate() local
364 for (int i = 0; i < from && spliterator.tryAdvance((IntConsumer) e -> { }); i++) { } in truncate()
365 … for (int i = 0; (i < size) && spliterator.tryAdvance((IntConsumer) nodeBuilder); i++) { } in truncate()
406 spliterator().forEachRemaining(consumer); in forEach()
[all …]
DNodes.java317 Spliterator<P_IN> spliterator, in collect() argument
320 long size = helper.exactOutputSizeIfKnown(spliterator); in collect()
321 if (size >= 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in collect()
325 new SizedCollectorTask.OfRef<>(spliterator, helper, array).invoke(); in collect()
328 Node<P_OUT> node = new CollectorTask.OfRef<>(helper, generator, spliterator).invoke(); in collect()
355 Spliterator<P_IN> spliterator, in collectInt() argument
357 long size = helper.exactOutputSizeIfKnown(spliterator); in collectInt()
358 if (size >= 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { in collectInt()
362 new SizedCollectorTask.OfInt<>(spliterator, helper, array).invoke(); in collectInt()
366 Node.OfInt node = new CollectorTask.OfInt<>(helper, spliterator).invoke(); in collectInt()
[all …]
DAbstractTask.java106 protected Spliterator<P_IN> spliterator; field in AbstractTask
137 Spliterator<P_IN> spliterator) { in AbstractTask() argument
140 this.spliterator = spliterator; in AbstractTask()
152 Spliterator<P_IN> spliterator) { in AbstractTask() argument
154 this.spliterator = spliterator; in AbstractTask()
168 protected abstract K makeChild(Spliterator<P_IN> spliterator); in makeChild() argument
292 Spliterator<P_IN> rs = spliterator, ls; // right, left spliterators in compute()
330 spliterator = null; in onCompletion()
DPipelineHelper.java94 abstract<P_IN> long exactOutputSizeIfKnown(Spliterator<P_IN> spliterator); in exactOutputSizeIfKnown() argument
110 abstract<P_IN, S extends Sink<P_OUT>> S wrapAndCopyInto(S sink, Spliterator<P_IN> spliterator); in wrapAndCopyInto() argument
127 abstract<P_IN> void copyInto(Sink<P_IN> wrappedSink, Spliterator<P_IN> spliterator); in copyInto() argument
143 abstract <P_IN> void copyIntoWithCancel(Sink<P_IN> wrappedSink, Spliterator<P_IN> spliterator); in copyIntoWithCancel() argument
165 abstract<P_IN> Spliterator<P_OUT> wrapSpliterator(Spliterator<P_IN> spliterator); in wrapSpliterator() argument
205 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()
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 …]
DFindOps.java151 Spliterator<S> spliterator) { in evaluateSequential() argument
152 O result = helper.wrapAndCopyInto(sinkSupplier.get(), spliterator).get(); in evaluateSequential()
158 Spliterator<P_IN> spliterator) { in evaluateParallel() argument
159 return new FindTask<>(this, helper, spliterator).invoke(); in evaluateParallel()
256 Spliterator<P_IN> spliterator) { in FindTask() argument
257 super(helper, spliterator); in FindTask()
261 FindTask(FindTask<P_IN, P_OUT, O> parent, Spliterator<P_IN> spliterator) { in FindTask() argument
262 super(parent, spliterator); in FindTask()
267 protected FindTask<P_IN, P_OUT, O> makeChild(Spliterator<P_IN> spliterator) { in makeChild() argument
268 return new FindTask<>(this, spliterator); in makeChild()
[all …]
DTerminalOp.java81 Spliterator<P_IN> spliterator) { in evaluateParallel() argument
84 return evaluateSequential(helper, spliterator); in evaluateParallel()
97 Spliterator<P_IN> spliterator); in evaluateSequential() argument
/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 …]
/libcore/ojluni/src/main/java/java/util/
DCollection.java561 default Spliterator<E> spliterator() { in spliterator() method
562 return Spliterators.spliterator(this, 0); in spliterator()
581 return StreamSupport.stream(spliterator(), false); in stream()
602 return StreamSupport.stream(spliterator(), true); in parallelStream()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DConcatTest.java119 … assertTrue(s1s.spliterator().hasCharacteristics(Spliterator.ORDERED), c1.getClass().toString()); in checkPrerequisites()
120 … assertTrue(s1p.spliterator().hasCharacteristics(Spliterator.ORDERED), c2.getClass().toString()); in checkPrerequisites()
121 … assertTrue(s2s.spliterator().hasCharacteristics(Spliterator.ORDERED), c1.getClass().toString()); in checkPrerequisites()
122 … assertTrue(s2p.spliterator().hasCharacteristics(Spliterator.ORDERED), c2.getClass().toString()); in checkPrerequisites()
148 assertConcatContent(result.spliterator(), ordered, expected.spliterator()); in assertRefConcat()
155 assertConcatContent(result.spliterator(), ordered, in assertIntConcat()
156 expected.stream().mapToInt(Integer::intValue).spliterator()); in assertIntConcat()
163 assertConcatContent(result.spliterator(), ordered, in assertLongConcat()
164 expected.stream().mapToLong(Integer::longValue).spliterator()); in assertLongConcat()
171 assertConcatContent(result.spliterator(), ordered, in assertDoubleConcat()
[all …]

1234567