Home
last modified time | relevance | path

Searched refs:IntStream (Results 1 – 25 of 65) sorted by relevance

123

/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DIntSliceOpTest.java36 import java.util.stream.IntStream;
59 assertCountSum(IntStream.range(0, 0).skip(0).boxed(), 0, 0); in testSkip()
60 assertCountSum(IntStream.range(0, 0).skip(4).boxed(), 0, 0); in testSkip()
61 assertCountSum(IntStream.range(1, 5).skip(4).boxed(), 0, 0); in testSkip()
62 assertCountSum(IntStream.range(1, 5).skip(2).boxed(), 2, 7); in testSkip()
63 assertCountSum(IntStream.range(1, 5).skip(0).boxed(), 4, 10); in testSkip()
65 assertCountSum(IntStream.range(0, 0).parallel().skip(0).boxed(), 0, 0); in testSkip()
66 assertCountSum(IntStream.range(0, 0).parallel().skip(4).boxed(), 0, 0); in testSkip()
67 assertCountSum(IntStream.range(1, 5).parallel().skip(4).boxed(), 0, 0); in testSkip()
68 assertCountSum(IntStream.range(1, 5).parallel().skip(2).boxed(), 2, 7); in testSkip()
[all …]
DIntPrimitiveOpsTests.java34 import java.util.stream.IntStream;
42 long sum = IntStream.range(1, 10).filter(i -> i % 2 == 0).sum(); in testSum()
47 long sum = IntStream.range(1, 10).filter(i -> i % 2 == 0).map(i -> i * 2).sum(); in testMap()
52 long sum = IntStream.range(1, 10).parallel().filter(i -> i % 2 == 0).sum(); in testParSum()
59 …long sum = IntStream.range(1, 10).filter(i -> i % 2 == 0).peek(i -> { teeSum[0] = teeSum[0] + i; }… in testTee()
66 IntStream.range(1, 10).filter(i -> i % 2 == 0).forEach(i -> { sum[0] = sum[0] + i; }); in testForEach()
73 IntStream.range(1, 10).parallel().filter(i -> i % 2 == 0).forEach(ai::addAndGet); in testParForEach()
78 List<Integer> l = IntStream.range(1, 10).parallel().boxed().collect(Collectors.toList()); in testBox()
90 int[] array = IntStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray()
95 int[] array = IntStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray()
[all …]
DStreamBuilderTest.java38 import java.util.stream.IntStream;
94 IntStream.range(0, size).boxed().forEach(sb); in testAfterBuilding()
106 IntStream.range(0, s).boxed().forEach(sb); in testStreamBuilder()
112 IntStream.range(0, s).boxed().forEach(i -> { in testStreamBuilder()
126 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder()
131 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder()
140 () -> IntStream.of(1)); in testIntSingleton()
155 IntStream.Builder sb = IntStream.builder(); in testIntAfterBuilding()
156 IntStream.range(0, size).forEach(sb); in testIntAfterBuilding()
167 IntStream.Builder sb = IntStream.builder(); in testIntStreamBuilder()
[all …]
DConcatOpTest.java34 import java.util.stream.IntStream;
52 s -> IntStream.concat(s, data.stream().mapToInt(Integer::intValue)), in testOps()
94 assertSized(IntStream.concat( in testIntSize()
95 IntStream.range(0, Integer.MAX_VALUE), in testIntSize()
96 IntStream.range(0, Integer.MAX_VALUE))); in testIntSize()
98 assertUnsized(IntStream.concat( in testIntSize()
102 assertUnsized(IntStream.concat( in testIntSize()
104 IntStream.iterate(0, i -> i + 1))); in testIntSize()
106 assertUnsized(IntStream.concat( in testIntSize()
107 IntStream.iterate(0, i -> i + 1), in testIntSize()
[all …]
DIntUniqOpTest.java33 import java.util.stream.IntStream;
47 assertCountSum(IntStream.generate(() -> 0).limit(10).distinct().boxed(), 1, 0); in testUniqOp()
48 assertCountSum(IntStream.generate(() -> 1).limit(10).distinct().boxed(), 1, 1); in testUniqOp()
49 assertCountSum(IntStream.range(0, 0).distinct().boxed(), 0, 0); in testUniqOp()
50 assertCountSum(IntStream.range(1, 11).distinct().boxed(), 10, 55); in testUniqOp()
51 assertCountSum(IntStream.range(1, 11).distinct().boxed(), 10, 55); in testUniqOp()
DExplodeOpTest.java41 import java.util.stream.IntStream;
56 = e -> IntStream.range(0, e).boxed();
84 exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10))); in testOps()
95 result = exerciseOps(data, s -> s.flatMap(i -> IntStream.empty())); in testIntOps()
98 exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e))); in testIntOps()
99 exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, e).limit(10))); in testIntOps()
128 exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream())); in testDoubleOps()
129 … exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream())); in testDoubleOps()
DStreamSpliteratorTest.java45 import java.util.stream.IntStream;
342 List<Consumer<IntStream>> terminalOps = Arrays.asList( in testIntSplitting()
348 List<UnaryOperator<IntStream>> intermediateOps = Arrays.asList( in testIntSplitting()
356 Consumer<IntStream> terminalOp = terminalOps.get(i); in testIntSplitting()
359 UnaryOperator<IntStream> intermediateOp = intermediateOps.get(j); in testIntSplitting()
364 … Spliterator.OfInt sp = intermediateOp.apply(IntStream.range(0, 1000)).spliterator(); in testIntSplitting()
366 IntStream s = StreamSupport.intStream(psp, true); in testIntSplitting()
386 for (Function<IntStream, IntStream> f : intStreamFunctions()) {
389 IntStream out = f.apply(in);
396 IntStream out = f.apply(in);
[all …]
DRangeTest.java32 import java.util.stream.IntStream;
71 int[] inc = IntStream.range(start, end).toArray(); in testIntRange()
91 int[] inc = IntStream.rangeClosed(start, end).toArray(); in testIntRange()
102 int[] inc = IntStream.rangeClosed(Integer.MAX_VALUE - 1, Integer.MAX_VALUE).toArray(); in testIntRange()
107 inc = IntStream.rangeClosed(Integer.MAX_VALUE, Integer.MAX_VALUE).toArray(); in testIntRange()
112 … () -> IntStream.rangeClosed(Integer.MAX_VALUE - 8, Integer.MAX_VALUE).spliterator()); in testIntRange()
117 Spliterator.OfInt s = IntStream.rangeClosed(Integer.MIN_VALUE, Integer.MAX_VALUE). in testIntRange()
124 return TestData.Factory.ofIntSupplier("int range", () -> IntStream.range(start, end)); in intRangeData()
128 … return TestData.Factory.ofIntSupplier("int rangeClosed", () -> IntStream.rangeClosed(start, end)); in intRangeClosedData()
138 "int range", () -> IntStream.iterate(0, i -> i + 1).limit(10000))). in testIntInfiniteRangeLimit()
[all …]
DMinMaxTest.java39 import java.util.stream.IntStream;
68 assertEquals(IntStream.empty().min(), OptionalInt.empty()); in testIntMinMax()
69 assertEquals(IntStream.empty().max(), OptionalInt.empty()); in testIntMinMax()
70 assertEquals(1, IntStream.range(1, 1001).min().getAsInt()); in testIntMinMax()
71 assertEquals(1000, IntStream.range(1, 1001).max().getAsInt()); in testIntMinMax()
DInfiniteStreamWithLimitOpTest.java46 import java.util.stream.IntStream;
81 (UnaryOperator<IntStream>) s -> s.limit(SKIP_LIMIT_SIZE)}); in intSliceFunctionsDataProvider()
83 (UnaryOperator<IntStream>) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); in intSliceFunctionsDataProvider()
153 () -> IntStream.range(l, u));
191 public void testIntSubsizedWithRange(String description, UnaryOperator<IntStream> fs) {
238 public void testIntUnorderedFinite(String description, UnaryOperator<IntStream> fs) {
319 …public void testIntUnorderedSizedNotSubsizedFinite(String description, UnaryOperator<IntStream> fs…
369 public void testIntUnorderedGenerator(String description, UnaryOperator<IntStream> fs) {
372 "[1, 1, ...]", () -> IntStream.generate(() -> 1));
418 public void testIntUnorderedIteration(String description, UnaryOperator<IntStream> fs) {
[all …]
DMatchOpTest.java47 import java.util.stream.IntStream;
176 private final Map<Kind, Function<IntPredicate, Function<IntStream, Boolean>>> intKinds
177 = new HashMap<Kind, Function<IntPredicate, Function<IntStream, Boolean>>>() {{
183 …private void assertIntPredicates(Supplier<IntStream> source, Kind kind, IntPredicate[] predicates,… in assertIntPredicates()
192 …assertIntPredicates(() -> IntStream.range(0, 0), Kind.ANY, INT_PREDICATES, false, false, false, fa… in testIntStreamMatches()
193 …assertIntPredicates(() -> IntStream.range(0, 0), Kind.ALL, INT_PREDICATES, true, true, true, true); in testIntStreamMatches()
194 …assertIntPredicates(() -> IntStream.range(0, 0), Kind.NONE, INT_PREDICATES, true, true, true, true… in testIntStreamMatches()
196 …assertIntPredicates(() -> IntStream.range(1, 2), Kind.ANY, INT_PREDICATES, true, false, false, tru… in testIntStreamMatches()
197 …assertIntPredicates(() -> IntStream.range(1, 2), Kind.ALL, INT_PREDICATES, true, false, false, tru… in testIntStreamMatches()
198 …assertIntPredicates(() -> IntStream.range(1, 2), Kind.NONE, INT_PREDICATES, false, true, true, fal… in testIntStreamMatches()
[all …]
DIntReduceTest.java29 import java.util.stream.IntStream;
39 int[] a = IntStream.range(1, 11).toArray(); in testReduce()
46 assertEquals(0, IntStream.empty().reduce(0, irPlus)); in testReduce()
47 assertFalse(IntStream.empty().reduce(irPlus).isPresent()); in testReduce()
DToArrayOpTest.java39 import java.util.stream.IntStream;
232 int[] ints = exerciseTerminalOps(data, s -> s.sorted(), (IntStream s) -> s.toArray());
255 private List<Function<IntStream, IntStream>> intUniqueAndSortedPermutations =
265 for (Function<IntStream, IntStream> f : intUniqueAndSortedPermutations) {
270 private List<Function<IntStream, IntStream>> intStatefulOpPermutations =
279 for (Function<IntStream, IntStream> f : intStatefulOpPermutations) {
DForEachOpTest.java44 import java.util.stream.IntStream;
137 () -> IntStream.range(1, 10001));
139 Function<IntStream, List<Integer>> terminalFunc = s -> {
160 Function<IntStream, List<Integer>> terminalFunc = s -> {
233 … () -> IntStream.range(1, 10001).asDoubleStream());
/libcore/ojluni/src/main/java/java/util/stream/
DIntStream.java73 public interface IntStream extends BaseStream<Integer, IntStream> { interface
88 IntStream filter(IntPredicate predicate); in filter()
102 IntStream map(IntUnaryOperator mapper); in map()
165 IntStream flatMap(IntFunction<? extends IntStream> mapper); in flatMap()
175 IntStream distinct(); in distinct()
186 IntStream sorted(); in sorted()
217 IntStream peek(IntConsumer action); in peek()
244 IntStream limit(long maxSize); in limit()
273 IntStream skip(long n); in skip()
674 IntStream sequential(); in sequential()
[all …]
DIntPipeline.java56 extends AbstractPipeline<E_IN, Integer, IntStream>
57 implements IntStream {
233 public final IntStream map(IntUnaryOperator mapper) {
305 public final IntStream flatMap(IntFunction<? extends IntStream> mapper) {
319 try (IntStream result = mapper.apply(t)) {
331 public IntStream unordered() {
344 public final IntStream filter(IntPredicate predicate) {
368 public final IntStream peek(IntConsumer action) {
389 public final IntStream limit(long maxSize) {
396 public final IntStream skip(long n) {
[all …]
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DIntStreamTestScenario.java51 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_FOR_EACH_WITH_CLOSE()
52 IntStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
63 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_TO_ARRAY()
72 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_ITERATOR()
81 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_SPLITERATOR()
90 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
98 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_SPLITERATOR_FOREACH()
105 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in PAR_STREAM_SEQUENTIAL_FOR_EACH()
113 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in PAR_STREAM_FOR_EACH_ORDERED()
122 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in PAR_STREAM_SPLITERATOR()
[all …]
DIntStreamTestDataProvider.java101 () -> IntStream.range(0, ints.length)));
103 () -> IntStream.rangeClosed(0, ints.length)));
133 () -> IntStream.range(0, ints.length).spliterator()));
135 … () -> IntStream.rangeClosed(0, ints.length).spliterator()));
143 static <T> Object[] streamDataDescr(String description, Supplier<IntStream> s) { in streamDataDescr()
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DIntStreamTestScenario.java48 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_FOR_EACH_WITH_CLOSE()
49 IntStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
60 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_TO_ARRAY()
69 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_ITERATOR()
78 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_SPLITERATOR()
87 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
95 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in STREAM_SPLITERATOR_FOREACH()
102 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in PAR_STREAM_SEQUENTIAL_FOR_EACH()
110 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in PAR_STREAM_FOR_EACH_ORDERED()
119 void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) { in PAR_STREAM_SPLITERATOR()
[all …]
DIntStreamTestDataProvider.java97 () -> IntStream.range(0, ints.length)));
99 () -> IntStream.rangeClosed(0, ints.length)));
129 () -> IntStream.range(0, ints.length).spliterator()));
131 … () -> IntStream.rangeClosed(0, ints.length).spliterator()));
139 static <T> Object[] streamDataDescr(String description, Supplier<IntStream> s) { in streamDataDescr()
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DStreamReuseTest.java177 (IntStream s) -> s.mapToObj(i -> i), (IntStream s) -> s.mapToObj(i -> i), in testTwoStreams()
181 IntStream::distinct, (IntStream s) -> s.mapToObj(i -> i), in testTwoStreams()
185 (IntStream s) -> s.mapToObj(i -> i), IntStream::distinct, in testTwoStreams()
189 IntStream::distinct, IntStream::distinct, in testTwoStreams()
197 IntStream::sum, IntStream::sum, in testTwoTerminals()
205 IntStream::sum, (IntStream s) -> s.mapToObj(i -> i), in testTerminalStream()
209 (IntStream s) -> s.mapToObj(i -> i), IntStream::sum, in testTerminalStream()
213 IntStream::sum, IntStream::distinct, in testTerminalStream()
217 IntStream::distinct, IntStream::sum, in testTerminalStream()
225 IntStream::iterator, IntStream::iterator, in testTwoIterators()
[all …]
DSliceSpliteratorTest.java74 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
87 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
129 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
143 … final Collection<Integer> source = IntStream.range(0, size).boxed().collect(toList()); in sliceSpliteratorDataProvider()
/libcore/ojluni/annotations/sdk/nullability/java/lang/
DCharSequence.annotated.java29 import java.util.stream.IntStream;
42 @libcore.util.NonNull public default java.util.stream.IntStream chars() { throw new RuntimeExceptio… in chars()
44 @libcore.util.NonNull public default java.util.stream.IntStream codePoints() { throw new RuntimeExc… in codePoints()
/libcore/ojluni/src/main/java/java/lang/
DCharSequence.java33 import java.util.stream.IntStream;
130 public default IntStream chars() { in chars()
177 public default IntStream codePoints() { in codePoints()
/libcore/ojluni/annotations/hiddenapi/java/util/
DRandom.java102 public java.util.stream.IntStream ints(long streamSize) { in ints()
106 public java.util.stream.IntStream ints() { in ints()
110 public java.util.stream.IntStream ints( in ints()
115 public java.util.stream.IntStream ints(int randomNumberOrigin, int randomNumberBound) { in ints()

123