/** * Processes exception in Subscriber.onNext. */ final void handleOnNext(Subscriber<? super T> s, Throwable ex) { BiConsumer<? super Subscriber<? super T>, ? super Throwable> h; try { if ((h = onNextHandler) != null) h.accept(s, ex); } catch (Throwable ignore) { } closeOnError(s, ex); }
/** * Returns a composed {@code BiConsumer} that performs, in sequence, {@code this_} * operation followed by the {@code after} operation. If performing either * operation throws an exception, it is relayed to the caller of the * composed operation. If performing the {@code this_} operation throws an exception, * the {@code after} operation will not be performed. * * @param <T> the type of the first argument to the BiConsumer operation * @param <U> the type of the second argument to the BiConsumer operation * @param this_ the operation to perform before the {@code after} operation * @param after the operation to perform after the {@code this_} operation * @return a composed {@code BiConsumer} that performs in sequence the {@code this_} * operation followed by the {@code after} operation * @throws NullPointerException if {@code this_} is null * @throws NullPointerException if {@code after} is null */ public static <T, U> BiConsumer<T, U> andThen(BiConsumer<? super T, ? super U> this_, BiConsumer<? super T, ? super U> after) { Objects.requireNonNull(this_); Objects.requireNonNull(after); return (l, r) -> { this_.accept(l, r); after.accept(l, r); }; }
/** * Returns a composed {@code BiConsumer} that performs, in sequence, {@code this_} * operation followed by the {@code after} operation. If performing either * operation throws an exception, it is relayed to the caller of the * composed operation. If performing the {@code this_} operation throws an exception, * the {@code after} operation will not be performed. * * @param <T> the type of the first argument to the BiConsumer operation * @param <U> the type of the second argument to the BiConsumer operation * @param this_ the operation to perform before the {@code after} operation * @param after the operation to perform after the {@code this_} operation * @return a composed {@code BiConsumer} that performs in sequence the {@code this_} * operation followed by the {@code after} operation * @throws NullPointerException if {@code this_} is null * @throws NullPointerException if {@code after} is null */ public static <T, U> BiConsumer<T, U> andThen(BiConsumer<? super T, ? super U> this_, BiConsumer<? super T, ? super U> after) { Objects.requireNonNull(this_); Objects.requireNonNull(after); return (l, r) -> { this_.accept(l, r); after.accept(l, r); }; }
@Override public final <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner) { Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left; }; return evaluate(ReduceOps.makeInt(supplier, accumulator, operator)); }
@Override public final <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R, R> combiner) { Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left; }; return evaluate(ReduceOps.makeDouble(supplier, accumulator, operator)); }
@Override public final <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner) { Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left; }; return evaluate(ReduceOps.makeLong(supplier, accumulator, operator)); }
action.accept(k, v);
@Override public final <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R, R> combiner) { Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left; }; return evaluate(ReduceOps.makeDouble(supplier, accumulator, operator)); }
@Override public final <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner) { Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left; }; return evaluate(ReduceOps.makeInt(supplier, accumulator, operator)); }
@Override public final <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner) { Objects.requireNonNull(combiner); BinaryOperator<R> operator = (left, right) -> { combiner.accept(left, right); return left; }; return evaluate(ReduceOps.makeLong(supplier, accumulator, operator)); }
throw cme; action.accept(k, v);
throw cme; action.accept(k, v);
t = tr; f.accept(t, x); if (x == null) { internalComplete(r);
@Override @SuppressWarnings("unchecked") public final <R, A> R collect(Collector<? super P_OUT, A, R> collector) { A container; if (isParallel() && (collector.characteristics().contains(Collector.Characteristics.CONCURRENT)) && (!isOrdered() || collector.characteristics().contains(Collector.Characteristics.UNORDERED))) { container = collector.supplier().get(); BiConsumer<A, ? super P_OUT> accumulator = collector.accumulator(); forEach(u -> accumulator.accept(container, u)); } else { container = evaluate(ReduceOps.makeRef(collector)); } return collector.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH) ? (R) container : collector.finisher().apply(container); }
@Override @SuppressWarnings("unchecked") public final <R, A> R collect(Collector<? super P_OUT, A, R> collector) { A container; if (isParallel() && (collector.characteristics().contains(Collector.Characteristics.CONCURRENT)) && (!isOrdered() || collector.characteristics().contains(Collector.Characteristics.UNORDERED))) { container = collector.supplier().get(); BiConsumer<A, ? super P_OUT> accumulator = collector.accumulator(); forEach(u -> accumulator.accept(container, u)); } else { container = evaluate(ReduceOps.makeRef(collector)); } return collector.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH) ? (R) container : collector.finisher().apply(container); }
@SuppressWarnings("unchecked") S ss = (S) s; f.accept(rr, ss); completeNull(); } catch (Throwable ex) {
BiConsumer<A, ? super U> downstreamAccumulator = downstream.accumulator(); return new CollectorImpl<>(downstream.supplier(), (r, t) -> downstreamAccumulator.accept(r, mapper.apply(t)), downstream.combiner(), downstream.finisher(), downstream.characteristics());
BiConsumer<A, ? super U> downstreamAccumulator = downstream.accumulator(); return new CollectorImpl<>(downstream.supplier(), (r, t) -> downstreamAccumulator.accept(r, mapper.apply(t)), downstream.combiner(), downstream.finisher(), downstream.characteristics());
(r, t) -> { if (predicate.test(t)) { downstreamAccumulator.accept(r, t);