Home
last modified time | relevance | path

Searched refs:apply (Results 1 – 25 of 106) sorted by relevance

12345

/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DSortedOpTest.java109 terminal.apply(s.apply(transform.apply(input.get()))); in testStreamTooLarge()
154 assertEquals(knownSize.apply(1).findFirst(), Optional.of(1)); in testSequentialShortCircuitTerminal()
155 assertEquals(knownSize.apply(1).findAny(), Optional.of(1)); in testSequentialShortCircuitTerminal()
156 assertEquals(unknownSize.apply(1).findFirst(), Optional.of(1)); in testSequentialShortCircuitTerminal()
157 assertEquals(unknownSize.apply(1).findAny(), Optional.of(1)); in testSequentialShortCircuitTerminal()
160 assertEquals(knownSize.apply(2).anyMatch(i -> i == 2), true); in testSequentialShortCircuitTerminal()
161 assertEquals(knownSize.apply(2).noneMatch(i -> i == 2), false); in testSequentialShortCircuitTerminal()
162 assertEquals(knownSize.apply(2).allMatch(i -> i == 2), false); in testSequentialShortCircuitTerminal()
163 assertEquals(unknownSize.apply(2).anyMatch(i -> i == 2), true); in testSequentialShortCircuitTerminal()
164 assertEquals(unknownSize.apply(2).noneMatch(i -> i == 2), false); in testSequentialShortCircuitTerminal()
[all …]
DInfiniteStreamWithLimitOpTest.java66 data.add(new Object[]{f.apply("Stream.limit(%d)"), in sliceFunctionsDataProvider()
68 data.add(new Object[]{f.apply("Stream.skip(%1$d).limit(%1$d)"), in sliceFunctionsDataProvider()
80 data.add(new Object[]{f.apply("IntStream.limit(%d)"), in intSliceFunctionsDataProvider()
82 data.add(new Object[]{f.apply("IntStream.skip(%1$d).limit(%1$d)"), in intSliceFunctionsDataProvider()
94 data.add(new Object[]{f.apply("LongStream.limit(%d)"), in longSliceFunctionsDataProvider()
96 data.add(new Object[]{f.apply("LongStream.skip(%1$d).limit(%1$d)"), in longSliceFunctionsDataProvider()
108 data.add(new Object[]{f.apply("DoubleStream.limit(%d)"), in doubleSliceFunctionsDataProvider()
110 data.add(new Object[]{f.apply("DoubleStream.skip(%1$d).limit(%1$d)"), in doubleSliceFunctionsDataProvider()
185 stream(s -> fs.apply(s)).
196 stream(s -> fs.apply(s)).
[all …]
DStreamLinkTest.java49 private <S> Function<S, S> apply(int n, Function<S, S> f) { in apply() method in StreamLinkTest
52 s = f.apply(s); in apply()
67 stream(apply(n, (Stream<Integer> s) -> s.map(e -> (Integer) (e + 1)))).
80 stream(apply(n, (IntStream s) -> s.map(e -> e + 1))). in testIntManyStreams()
93 stream(apply(n, (LongStream s) -> s.map(e -> e + 1L))). in testLongManyStreams()
106 stream(apply(n, (DoubleStream s) -> s.map(e -> e + 1.0))). in testDoubleManyStreams()
DMatchOpTest.java101 boolean match = this.<T>kinds().get(kind).apply(predicates[i]).apply(source.stream()); in assertPredicates()
126 exerciseTerminalOps(data, this.<Integer>kinds().get(kind).apply(p)); in testStream()
127 … exerciseTerminalOps(data, s -> s.filter(pFalse), this.<Integer>kinds().get(kind).apply(p)); in testStream()
128 … exerciseTerminalOps(data, s -> s.filter(pEven), this.<Integer>kinds().get(kind).apply(p)); in testStream()
186 boolean match = intKinds.get(kind).apply(predicates[i]).apply(source.get()); in assertIntPredicates()
211 exerciseTerminalOps(data, intKinds.get(kind).apply(p)); in testIntStream()
212 exerciseTerminalOps(data, s -> s.filter(ipFalse), intKinds.get(kind).apply(p)); in testIntStream()
213 exerciseTerminalOps(data, s -> s.filter(ipEven), intKinds.get(kind).apply(p)); in testIntStream()
271 boolean match = longKinds.get(kind).apply(predicates[i]).apply(source.get()); in assertLongPredicates()
296 exerciseTerminalOps(data, longKinds.get(kind).apply(p)); in testLongStream()
[all …]
DFindFirstOpTest.java70 Iterator<Integer> i = fs.apply(data.stream()).iterator(); in exerciseStream()
75 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseStream()
90 PrimitiveIterator.OfInt i = fs.apply(data.stream()).iterator(); in exerciseIntStream()
95 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseIntStream()
110 PrimitiveIterator.OfLong i = fs.apply(data.stream()).iterator(); in exerciseLongStream()
115 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseLongStream()
130 PrimitiveIterator.OfDouble i = fs.apply(data.stream()).iterator(); in exerciseDoubleStream()
135 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseDoubleStream()
DStreamSpliteratorTest.java268 Spliterator<Integer> sp = intermediateOp.apply(l.stream()).spliterator(); in testSplitting()
293 Stream<Integer> out = f.apply(in);
300 Stream<Integer> out = f.apply(in);
310 SpliteratorTestHelper.testSpliterator(() -> f.apply(data.stream()).spliterator()); in testSpliterators()
317 … SpliteratorTestHelper.testSpliterator(() -> f.apply(data.parallelStream()).spliterator()); in testParSpliterators()
364 … Spliterator.OfInt sp = intermediateOp.apply(IntStream.range(0, 1000)).spliterator(); in testIntSplitting()
389 IntStream out = f.apply(in);
396 IntStream out = f.apply(in);
406 SpliteratorTestHelper.testIntSpliterator(() -> f.apply(data.stream()).spliterator()); in testIntSpliterators()
413 … SpliteratorTestHelper.testIntSpliterator(() -> f.apply(data.parallelStream()).spliterator()); in testIntParSpliterators()
[all …]
DFindAnyOpTest.java78 Iterator<Integer> it = fs.apply(data.stream()).iterator(); in exerciseStream()
86 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseStream()
102 PrimitiveIterator.OfInt it = fs.apply(data.stream()).iterator(); in exerciseIntStream()
110 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseIntStream()
126 PrimitiveIterator.OfLong it = fs.apply(data.stream()).iterator(); in exerciseLongStream()
134 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseLongStream()
150 PrimitiveIterator.OfDouble it = fs.apply(data.stream()).iterator(); in exerciseDoubleStream()
158 assertFalse(fs.apply(data.stream()).iterator().hasNext()); in exerciseDoubleStream()
DSequentialOpTest.java75 Stream<Integer> stream = config.apply(supp.get()); in testLazy()
86 stream = config.apply(supp.get()); in testLazy()
129 … UnaryOperator<Stream<Integer>> composed = s -> s2.apply(c2.apply(s1.apply(c1.apply(s)))); in testMixedSeqPar()
/libcore/ojluni/src/main/java/java/util/function/
DFunction.java49 R apply(T t); in apply() method
68 return (V v) -> apply(before.apply(v)); in compose()
88 return (T t) -> after.apply(apply(t)); in andThen()
DBiFunction.java53 R apply(T t, U u); in apply() method
70 return (T t, U u) -> after.apply(apply(t, u)); in andThen()
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DIntStreamTestScenario.java52 IntStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
64 for (int t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
73 … for (PrimitiveIterator.OfInt seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
82 … for (Spliterator.OfInt spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
91 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
99 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
106 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
115 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
123 … for (Spliterator.OfInt spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); ) { in PAR_STREAM_SPLITERATOR()
132 m.apply(data.parallelStream()).spliterator().forEachRemaining(b); in PAR_STREAM_SPLITERATOR_FOREACH()
[all …]
DDoubleStreamTestScenario.java53 DoubleStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
65 for (double t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
74 … for (PrimitiveIterator.OfDouble seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
83 … for (Spliterator.OfDouble spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
92 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
100 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
107 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
116 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
124 …for (Spliterator.OfDouble spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); )… in PAR_STREAM_SPLITERATOR()
133 m.apply(data.parallelStream()).spliterator().forEachRemaining(b); in PAR_STREAM_SPLITERATOR_FOREACH()
[all …]
DLongStreamTestScenario.java52 LongStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
64 for (long t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
73 … for (PrimitiveIterator.OfLong seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
82 … for (Spliterator.OfLong spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
91 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
99 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
106 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
115 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
123 … for (Spliterator.OfLong spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); ) { in PAR_STREAM_SPLITERATOR()
132 m.apply(data.parallelStream()).spliterator().forEachRemaining(b); in PAR_STREAM_SPLITERATOR_FOREACH()
[all …]
DStreamTestScenario.java51 Stream<U> s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
64 for (U t : m.apply(data.stream()).collect(Collectors.toList())) { in STREAM_COLLECT()
74 for (Object t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
84 for (Iterator<U> seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
93 for (Spliterator<U> spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { } in STREAM_SPLITERATOR()
101 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
109 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
117 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
126 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
134 … for (Spliterator<U> spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); ) { } in PAR_STREAM_SPLITERATOR()
[all …]
DSpliteratorTestHelper.java154 Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add); in testSpliterator()
208 Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add); in testForEach()
212 spliterator.forEachRemaining(boxingAdapter.apply( in testForEach()
215 spliterator.tryAdvance(boxingAdapter.apply( in testForEach()
238 Consumer<T> addToFromTryAdvance = boxingAdapter.apply(fromTryAdvance::add); in testTryAdvance()
242 spliterator.forEachRemaining(boxingAdapter.apply( in testTryAdvance()
245 spliterator.tryAdvance(boxingAdapter.apply( in testTryAdvance()
269 Consumer<T> addToDest = boxingAdapter.apply(dest::add); in testMixedTryAdvanceForEach()
274 spliterator.forEachRemaining(boxingAdapter.apply( in testMixedTryAdvanceForEach()
277 spliterator.tryAdvance(boxingAdapter.apply( in testMixedTryAdvanceForEach()
[all …]
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DIntStreamTestScenario.java49 IntStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
61 for (int t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
70 … for (PrimitiveIterator.OfInt seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
79 … for (Spliterator.OfInt spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
88 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
96 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
103 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
112 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
120 … for (Spliterator.OfInt spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); ) { in PAR_STREAM_SPLITERATOR()
129 m.apply(data.parallelStream()).spliterator().forEachRemaining(b); in PAR_STREAM_SPLITERATOR_FOREACH()
[all …]
DDoubleStreamTestScenario.java49 DoubleStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
61 for (double t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
70 … for (PrimitiveIterator.OfDouble seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
79 … for (Spliterator.OfDouble spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
88 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
96 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
103 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
112 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
120 …for (Spliterator.OfDouble spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); )… in PAR_STREAM_SPLITERATOR()
129 m.apply(data.parallelStream()).spliterator().forEachRemaining(b); in PAR_STREAM_SPLITERATOR_FOREACH()
[all …]
DLongStreamTestScenario.java49 LongStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
61 for (long t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
70 … for (PrimitiveIterator.OfLong seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
79 … for (Spliterator.OfLong spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
88 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
96 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
103 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
112 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
120 … for (Spliterator.OfLong spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); ) { in PAR_STREAM_SPLITERATOR()
129 m.apply(data.parallelStream()).spliterator().forEachRemaining(b); in PAR_STREAM_SPLITERATOR_FOREACH()
[all …]
DStreamTestScenario.java48 Stream<U> s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
61 for (U t : m.apply(data.stream()).collect(Collectors.toList())) { in STREAM_COLLECT()
71 for (Object t : m.apply(data.stream()).toArray()) { in STREAM_TO_ARRAY()
81 for (Iterator<U> seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); ) in STREAM_ITERATOR()
90 for (Spliterator<U> spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { } in STREAM_SPLITERATOR()
98 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
106 m.apply(data.stream()).spliterator().forEachRemaining(b); in STREAM_SPLITERATOR_FOREACH()
114 m.apply(data.parallelStream()).sequential().forEach(b); in PAR_STREAM_SEQUENTIAL_FOR_EACH()
123 m.apply(data.parallelStream()).forEachOrdered(b); in PAR_STREAM_FOR_EACH_ORDERED()
131 … for (Spliterator<U> spl = m.apply(data.parallelStream()).spliterator(); spl.tryAdvance(b); ) { } in PAR_STREAM_SPLITERATOR()
[all …]
DSpliteratorTestHelper.java154 Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add); in testSpliterator()
208 Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add); in testForEach()
212 spliterator.forEachRemaining(boxingAdapter.apply( in testForEach()
215 spliterator.tryAdvance(boxingAdapter.apply( in testForEach()
238 Consumer<T> addToFromTryAdvance = boxingAdapter.apply(fromTryAdvance::add); in testTryAdvance()
242 spliterator.forEachRemaining(boxingAdapter.apply( in testTryAdvance()
245 spliterator.tryAdvance(boxingAdapter.apply( in testTryAdvance()
269 Consumer<T> addToDest = boxingAdapter.apply(dest::add); in testMixedTryAdvanceForEach()
274 spliterator.forEachRemaining(boxingAdapter.apply( in testMixedTryAdvanceForEach()
277 spliterator.tryAdvance(boxingAdapter.apply( in testMixedTryAdvanceForEach()
[all …]
/libcore/luni/src/test/java/libcore/java/util/function/
DFunctionTest.java27 assertSame(o, Function.identity().apply(o)); in testIdentity()
28 assertNull(Function.identity().apply(null)); in testIdentity()
34 assertEquals(11.0d, plusOne.compose(twice).apply(5.0d)); in testCompose()
48 assertEquals(12.0d, plusOne.andThen(twice).apply(5.0d)); in testAndThen()
DUnaryOperatorTest.java27 assertSame(arg, UnaryOperator.identity().apply(arg)); in testIdentity()
28 assertNull(null, UnaryOperator.identity().apply(null)); in testIdentity()
/libcore/luni/src/test/java/libcore/sun/security/x509/
DUtils.java55 Object o = objectCreator.apply(ba); in testWithEachSinglePart()
70 + suffix, objectCreator.apply(allOnes).toString()); in testWithAllParts()
76 assertEquals(prefix + suffix, objectCreator.apply(new byte[0]).toString()); in testWithNoParts()
79 assertEquals(prefix + suffix, objectCreator.apply(new byte[parts.length]).toString()); in testWithNoParts()
91 assertEquals(prefix + expectedResult + suffix, objectCreator.apply(ba).toString()); in testWithEveryOtherPart()
/libcore/ojluni/src/main/java/java/util/concurrent/atomic/
DAtomicReference.java162 next = updateFunction.apply(prev); in getAndUpdate()
181 next = updateFunction.apply(prev); in updateAndGet()
205 next = accumulatorFunction.apply(prev, x); in getAndAccumulate()
229 next = accumulatorFunction.apply(prev, x); in accumulateAndGet()
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentMap.java290 while (!replace(k, v, function.apply(k, v))) { in replaceAll()
332 && (newValue = mappingFunction.apply(key)) != null in computeIfAbsent()
373 V newValue = remappingFunction.apply(key, oldValue); in computeIfPresent()
423 V newValue = remappingFunction.apply(key, oldValue); in compute()
486 V newValue = remappingFunction.apply(oldValue, value); in merge()

12345