@Override public void subscribe(Subscriber<? super T>[] s) { if (validate(s)) { int n = s.length; @SuppressWarnings("unchecked") Subscriber<? super T>[] parents = new Subscriber[n]; for (int i = 0; i < n; i++) { Subscriber<? super T> z = s[i]; if (z instanceof ConditionalSubscriber) { parents[i] = new OnAssemblyConditionalSubscriber<T>((ConditionalSubscriber<? super T>)z, assembled); } else { parents[i] = new OnAssemblySubscriber<T>(z, assembled); } } source.subscribe(parents); } }
@Override protected void subscribeActual(Subscriber<? super T> s) { if (s instanceof ConditionalSubscriber) { source.subscribe(new OnAssemblyConditionalSubscriber<T>((ConditionalSubscriber<? super T>)s, assembled)); } else { source.subscribe(new OnAssemblySubscriber<T>(s, assembled)); } }
@Override protected void subscribeActual(Subscriber<? super R> s) { if (s instanceof ConditionalSubscriber) { source.subscribe(new MapOptionalConditionalSubscriber<>((ConditionalSubscriber<? super R>)s, mapper)); } else { source.subscribe(new MapOptionalSubscriber<>(s, mapper)); } }
@Override protected void subscribeActual(Subscriber<? super T> s) { if (s instanceof ConditionalSubscriber) { s.onSubscribe(new RepeatCallableConditionalSubscription<T>((ConditionalSubscriber<? super T>)s, callable)); } else { s.onSubscribe(new RepeatCallableSubscription<T>(s, callable)); } }
@Override protected void subscribeActual(Subscriber<? super T> s) { if (s instanceof ConditionalSubscriber) { s.onSubscribe(new RepeatScalarConditionalSubscription<T>((ConditionalSubscriber<? super T>)s, value)); } else { s.onSubscribe(new RepeatScalarSubscription<T>(s, value)); } }
@Override protected void subscribeActual(Subscriber<? super R> s) { if (s instanceof ConditionalSubscriber) { source.subscribe(new MapFilterConditionalSubscriber<T, R>((ConditionalSubscriber<? super R>)s, consumer)); } else { source.subscribe(new MapFilterSubscriber<T, R>(s, consumer)); } }
public MapOptionalConditionalSubscriber(ConditionalSubscriber<? super R> actual, Function<? super T, Optional<R>> mapper) { super(actual); this.mapper = mapper; }
RepeatCallableConditionalSubscription(ConditionalSubscriber<? super T> actual, Callable<T> callable) { this.actual = actual; this.callable = callable; }
RepeatScalarConditionalSubscription(ConditionalSubscriber<? super T> actual, T value) { this.actual = actual; this.value = value; }
MapFilterConditionalSubscriber(ConditionalSubscriber<? super R> actual, BiConsumer<? super T, ? super BasicEmitter<R>> consumer) { super(actual); this.consumer = consumer; }