/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | SequentialOpTest.java | 39 import java.util.stream.Stream; 56 …Supplier<Stream<Integer>>[] suppliers = new Supplier[] { () -> data.stream(), () -> data.parallelS… in testLazy() 57 UnaryOperator<Stream<Integer>>[] configs in testLazy() 59 … (UnaryOperator<Stream<Integer>>) s -> s.peek(e -> { counter.incrementAndGet(); }), in testLazy() 60 …(UnaryOperator<Stream<Integer>>) s -> s.map(id).peek(e -> { counter.incrementAndGet(); }).sequenti… in testLazy() 61 …(UnaryOperator<Stream<Integer>>) s -> s.map(id).peek(e -> { counter.incrementAndGet(); }).parallel… in testLazy() 62 (UnaryOperator<Stream<Integer>>) s -> s.sequential().map(id).peek(e -> { in testLazy() 65 …(UnaryOperator<Stream<Integer>>) s -> s.parallel().map(id).peek(e -> { counter.incrementAndGet(); … in testLazy() 70 Supplier<Stream<Integer>> supp = suppliers[i]; in testLazy() 73 UnaryOperator<Stream<Integer>> config = configs[j]; in testLazy() [all …]
|
D | StreamCloseTest.java | 28 import java.util.stream.Stream; 42 try (Stream<Integer> ints = countTo(100).stream()) { in testEmptyCloseHandler() 51 try (Stream<Integer> ints = countTo(100).stream()) { in testOneCloseHandler() 58 try (Stream<Integer> ints = countTo(100).stream().onClose(closer)) { in testOneCloseHandler() 64 try (Stream<Integer> ints = countTo(100).stream().filter(e -> true).onClose(closer)) { in testOneCloseHandler() 70 …try (Stream<Integer> ints = countTo(100).stream().filter(e -> true).onClose(closer).filter(e -> tr… in testOneCloseHandler() 81 try (Stream<Integer> ints = countTo(100).stream()) { in testTwoCloseHandlers() 88 try (Stream<Integer> ints = countTo(100).stream().onClose(close1).onClose(close2)) { in testTwoCloseHandlers() 94 …try (Stream<Integer> ints = countTo(100).stream().filter(e -> true).onClose(close1).onClose(close2… in testTwoCloseHandlers() 100 …try (Stream<Integer> ints = countTo(100).stream().filter(e -> true).onClose(close1).onClose(close2… in testTwoCloseHandlers() [all …]
|
D | ConcatTest.java | 42 import java.util.stream.Stream; 109 Stream<Integer> s1s = c1.stream(); in checkPrerequisites() 110 Stream<Integer> s2s = c2.stream(); in checkPrerequisites() 111 Stream<Integer> s1p = c1.parallelStream(); in checkPrerequisites() 112 Stream<Integer> s2p = c2.parallelStream(); in checkPrerequisites() 145 …private void assertRefConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ord… in assertRefConcat() 146 Stream<Integer> result = Stream.concat(s1, s2); in assertRefConcat() 151 …private void assertIntConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ord… in assertIntConcat() 159 …private void assertLongConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean or… in assertLongConcat() 167 …private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean … in assertDoubleConcat()
|
D | ConcatOpTest.java | 33 import java.util.stream.Stream; 51 s -> Stream.concat(s, data.stream()), in testOps() 58 assertSized(Stream.concat( in testSize() 62 assertUnsized(Stream.concat( in testSize() 66 assertUnsized(Stream.concat( in testSize() 68 Stream.iterate(0, i -> i + 1))); in testSize() 70 assertUnsized(Stream.concat( in testSize() 71 Stream.iterate(0, i -> i + 1), in testSize()
|
D | StreamSpliteratorTest.java | 47 import java.util.stream.Stream; 248 List<Consumer<Stream<Integer>>> terminalOps = Arrays.asList( in testSplitting() 254 List<UnaryOperator<Stream<Integer>>> intermediateOps = Arrays.asList( in testSplitting() 262 Consumer<Stream<Integer>> terminalOp = terminalOps.get(i); in testSplitting() 265 UnaryOperator<Stream<Integer>> intermediateOp = intermediateOps.get(j); in testSplitting() 270 Stream<Integer> s = StreamSupport.stream(psp, true); in testSplitting() 290 for (Function<Stream<Integer>, Stream<Integer>> f : streamFunctions()) { 292 stream((Stream<Integer> in) -> { 293 Stream<Integer> out = f.apply(in); 299 stream((Stream<Integer> in) -> { [all …]
|
D | StreamBuilderTest.java | 40 import java.util.stream.Stream; 78 () -> Stream.of(1)); in testSingleton() 93 Stream.Builder<Integer> sb = Stream.builder(); in testAfterBuilding() 105 Stream.Builder<Integer> sb = Stream.builder(); in testStreamBuilder() 111 Stream.Builder<Integer> sb = Stream.builder(); in testStreamBuilder() 113 Stream.Builder<Integer> _sb = sb.add(i); in testStreamBuilder() 120 private void testStreamBuilder(int size, Function<Integer, Stream<Integer>> supplier) { in testStreamBuilder()
|
D | DistinctOpTest.java | 45 import java.util.stream.Stream; 72 … Optional<Integer> oi = Stream.iterate(1, i -> i + 1).unordered().parallel().distinct().findAny(); in testWithUnorderedInfiniteStream() 83 Stream::distinct, in testOp() 95 Collection<Integer> node = exerciseOps(data, Stream::distinct); in testOpWithNull() 113 Collection<Integer> node = exerciseOps(new SortedTestData<>(l), Stream::distinct); in testOpWithNullSorted() 183 TestData<Integer, Stream<Integer>> data = TestData.Factory.ofCollection( in testStable() 187 .stream(Stream::distinct) in testStable()
|
D | StreamParSeqTest.java | 28 import java.util.stream.Stream; 37 Stream<Integer> s = Arrays.asList(1, 2, 3, 4).stream().parallel(); in testParSeq()
|
D | InfiniteStreamWithLimitOpTest.java | 48 import java.util.stream.Stream; 67 (UnaryOperator<Stream>) s -> s.limit(SKIP_LIMIT_SIZE)}); in sliceFunctionsDataProvider() 69 (UnaryOperator<Stream>) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); in sliceFunctionsDataProvider() 180 public void testSubsizedWithRange(String description, UnaryOperator<Stream<Long>> fs) { 227 public void testUnorderedFinite(String description, UnaryOperator<Stream<Long>> fs) { 307 …public void testUnorderedSizedNotSubsizedFinite(String description, UnaryOperator<Stream<Long>> fs… 358 public void testUnorderedGenerator(String description, UnaryOperator<Stream<Long>> fs) { 361 "[1L, 1L, ...]", () -> Stream.generate(() -> 1L)); 405 public void testUnorderedIteration(String description, UnaryOperator<Stream<Long>> fs) { 408 "[1L, 2L, 3L, ...]", () -> Stream.iterate(1L, i -> i + 1L));
|
D | ToArrayOpTest.java | 38 import java.util.stream.Stream; 111 private List<Function<Stream<Integer>, Stream<Integer>>> uniqueAndSortedPermutations = 121 for (Function<Stream<Integer>, Stream<Integer>> f : uniqueAndSortedPermutations) { in testDistinctAndSortedPermutations() 143 private List<Function<Stream<Integer>, Stream<Integer>>> statefulOpPermutations = 183 for (Function<Stream<Integer>, Stream<Integer>> f : statefulOpPermutations) {
|
D | SortedOpTest.java | 44 import java.util.stream.Stream; 58 Function<LongStream, Stream<Long>> f = s -> in testRefStreamTooLarge() 63 testStreamTooLarge(f, Stream::findFirst); in testRefStreamTooLarge() 148 Function<Integer, Stream<Integer>> knownSize = i -> assertNCallsOnly( in testSequentialShortCircuitTerminal() 149 l.stream().sorted(), Stream::peek, i); in testSequentialShortCircuitTerminal() 150 Function<Integer, Stream<Integer>> unknownSize = i -> assertNCallsOnly in testSequentialShortCircuitTerminal() 151 (unknownSizeStream(l).sorted(), Stream::peek, i); in testSequentialShortCircuitTerminal() 168 private <T> Stream<T> unknownSizeStream(List<T> l) { in unknownSizeStream() 174 …Collection<Integer> result = exerciseOpsInt(data, Stream::sorted, IntStream::sorted, LongStream::s… in testOps()
|
D | SliceOpTest.java | 40 import java.util.stream.Stream; 288 Function<Stream<Integer>, Stream<Integer>> mRef, 294 Function<Stream<Integer>, Stream<Integer>>[] ms = new Function[4]; 305 Function<Stream<Integer>, Stream<Integer>>... ms) { 308 Function<Stream<Integer>, Stream<Integer>> m = ms[i];
|
D | ExplodeOpTest.java | 40 import java.util.stream.Stream; 55 static final Function<Integer, Stream<Integer>> integerRangeMapper 60 Stream<String> strings = Arrays.asList(stringsArray).stream(); in testFlatMap() 79 result = exerciseOps(data, s-> s.flatMap(e -> Stream.empty())); in testOps()
|
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/ |
D | StreamFlagsTest.java | 28 import java.util.stream.Stream; 43 Stream<String> arrayList = new ArrayList<String>().stream(); 44 Stream<String> linkedList = new LinkedList<String>().stream(); 45 Stream<String> hashSet = new HashSet<String>().stream(); 46 Stream<String> treeSet = new TreeSet<String>().stream(); 47 Stream<String> linkedHashSet = new LinkedHashSet<String>().stream(); 48 Stream<String> repeat = Stream.generate(() -> ""); 50 Stream<?>[] streams = { arrayList, linkedList, hashSet, treeSet, linkedHashSet, repeat }; 60 Stream<String> arrayList = new ArrayList<String>().stream(); in testBaseStreams() 61 Stream<String> linkedList = new LinkedList<String>().stream(); in testBaseStreams() [all …]
|
D | StreamReuseTest.java | 85 public void testTwoStreams(String name, TestData<Integer, Stream<Integer>> data) { in testTwoStreams() 87 … (Stream<Integer> s) -> s.map(i -> i), (Stream<Integer> s) -> s.map(i -> i), in testTwoStreams() 91 Stream::distinct, (Stream<Integer> s) -> s.map(i -> i), in testTwoStreams() 95 (Stream<Integer> s) -> s.map(i -> i), Stream::distinct, in testTwoStreams() 99 Stream::distinct, Stream::distinct, in testTwoStreams() 105 public void testTwoTerminals(String name, TestData<Integer, Stream<Integer>> data) { in testTwoTerminals() 107 Stream::findFirst, Stream::findFirst, in testTwoTerminals() 113 public void testTerminalStream(String name, TestData<Integer, Stream<Integer>> data) { in testTerminalStream() 115 Stream::findFirst, (Stream<Integer> s) -> s.map(i -> i), in testTerminalStream() 119 (Stream<Integer> s) -> s.map(i -> i), Stream::findFirst, in testTerminalStream() [all …]
|
D | FlagOpTest.java | 39 public void testFlagsPassThrough(String name, TestData<Integer, Stream<Integer>> data) { in testFlagsPassThrough() 110 …TestData<Integer, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(ne… in testFlagsClearAllSet() 149 …TestData<Integer, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(ne… in testFlagsSetAllClear() 183 …TestData<Integer, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(ne… in testFlagsSetSequence() 219 …TestData<Integer, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(ne… in testFlagsClearSequence() 245 …TestData<Integer, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(ne… in testFlagsSizedOrderedParallelCollect()
|
/libcore/ojluni/src/main/java/java/util/stream/ |
D | Stream.java | 154 public interface Stream<T> extends BaseStream<T, Stream<T>> { interface 169 Stream<T> filter(Predicate<? super T> predicate); in filter() 184 <R> Stream<R> map(Function<? super T, ? extends R> mapper); in map() 270 <R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper); in flatMap() 359 Stream<T> distinct(); in distinct() 375 Stream<T> sorted(); in sorted() 392 Stream<T> sorted(Comparator<? super T> comparator); in sorted() 423 Stream<T> peek(Consumer<? super T> action); in peek() 450 Stream<T> limit(long maxSize); in limit() 479 Stream<T> skip(long n); in skip() [all …]
|
D | ReferencePipeline.java | 60 extends AbstractPipeline<P_IN, P_OUT, Stream<P_OUT>> 61 implements Stream<P_OUT> { 156 public Stream<P_OUT> unordered() { in unordered() 169 public final Stream<P_OUT> filter(Predicate<? super P_OUT> predicate) { 194 public final <R> Stream<R> map(Function<? super P_OUT, ? extends R> mapper) { 265 …public final <R> Stream<R> flatMap(Function<? super P_OUT, ? extends Stream<? extends R>> mapper) { 280 try (Stream<? extends R> result = mapper.apply(u)) { 379 public final Stream<P_OUT> peek(Consumer<? super P_OUT> action) { 400 public final Stream<P_OUT> distinct() { 405 public final Stream<P_OUT> sorted() { [all …]
|
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/ |
D | StreamTestScenario.java | 47 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_FOR_EACH_WITH_CLOSE() 48 Stream<U> s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE() 60 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_COLLECT() 70 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_TO_ARRAY() 80 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_ITERATOR() 89 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_SPLITERATOR() 97 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT() 105 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_SPLITERATOR_FOREACH() 113 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in PAR_STREAM_SEQUENTIAL_FOR_EACH() 121 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in PAR_STREAM_FOR_EACH_ORDERED() [all …]
|
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/ |
D | StreamTestScenario.java | 50 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_FOR_EACH_WITH_CLOSE() 51 Stream<U> s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE() 63 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_COLLECT() 73 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_TO_ARRAY() 83 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_ITERATOR() 92 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_SPLITERATOR() 100 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT() 108 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in STREAM_SPLITERATOR_FOREACH() 116 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in PAR_STREAM_SEQUENTIAL_FOR_EACH() 124 void _run(TestData<T, S_IN> data, Consumer<U> b, Function<S_IN, Stream<U>> m) { in PAR_STREAM_FOR_EACH_ORDERED() [all …]
|
D | StreamOpFlagTestHelper.java | 28 import java.util.stream.Stream; 48 public static boolean isStreamOrdered(Stream<?> s) { in isStreamOrdered()
|
/libcore/luni/src/test/java/libcore/java/util/stream/ |
D | StreamTest.java | 24 import java.util.stream.Stream; 52 String[] array = Stream.of(object).toArray(String[]::new); in streamOfSingleObject() 63 String[] destArray = Stream.of(sourceArray) in streamOfObjects()
|
/libcore/ojluni/src/main/java/java/util/ |
D | Collection.java | 29 import java.util.stream.Stream; 580 default Stream<E> stream() { in stream() 601 default Stream<E> parallelStream() { in parallelStream()
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/ |
D | FillableStringTest.java | 28 import java.util.stream.Stream; 36 public Stream<String> generate() { in generate()
|
/libcore/ojluni/annotations/sdk/nullability/java/util/ |
D | Collection.annotated.java | 29 import java.util.stream.Stream; 69 @libcore.util.NonNull public default java.util.stream.Stream<@libcore.util.NullFromTypeParam E> str… in stream() 71 @libcore.util.NonNull public default java.util.stream.Stream<@libcore.util.NullFromTypeParam E> par… in parallelStream()
|