Top Description Inners Fields Constructors Methods
io.reactivex.internal.operators.maybe

public final Class MaybeFlatMapIterableFlowable<T, R>

extends Flowable<R>
Class Inheritance
Type Parameters
<T>
the source value type
<R>
the element type of the Iterable
Imports
java.util.Iterator, java.util.concurrent.atomic.AtomicLong, io.reactivex.annotations.Nullable, org.reactivestreams.Subscriber, io.reactivex.*, io.reactivex.disposables.Disposable, io.reactivex.exceptions.Exceptions, io.reactivex.functions.Function, io.reactivex.internal.disposables.DisposableHelper, io.reactivex.internal.functions.ObjectHelper, io.reactivex.internal.subscriptions.*, io.reactivex.internal.util.BackpressureHelper

Maps a success value into an Iterable and streams it back as a Flowable.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final Function<? super T, ? extends Iterable<? extends R>>
pack-priv final MaybeSource<T>

Constructor Summary

AccessConstructor and Description
public
MaybeFlatMapIterableFlowable(MaybeSource<T> source, Function<? super T, ? extends Iterable<? extends R>> mapper)

Method Summary

Modifier and TypeMethod and Description
protected void
subscribeActual(Subscriber<? super R>
the incoming Subscriber, never null
s
)

Implements abstract io.reactivex.Flowable.subscribeActual.

Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Subscribers.
Inherited from io.reactivex.Flowable:
allambambArrayambWithanyasblockingFirstblockingFirstblockingForEachblockingIterableblockingIterableblockingLastblockingLastblockingLatestblockingMostRecentblockingNextblockingSingleblockingSingleblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribebufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferSizecachecacheWithInitialCapacitycastcollectcollectIntocombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestDelayErrorcombineLatestDelayErrorcombineLatestDelayErrorcombineLatestDelayErrorcombineLatestDelayErrorcombineLatestDelayErrorcomposeconcatconcatconcatconcatconcatconcatconcatArrayconcatArrayDelayErrorconcatArrayEagerconcatArrayEagerconcatArrayEagerDelayErrorconcatArrayEagerDelayErrorconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatEagerconcatEagerconcatEagerconcatEagerconcatMapconcatMapconcatMapCompletableconcatMapCompletableconcatMapCompletableDelayErrorconcatMapCompletableDelayErrorconcatMapCompletableDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapEagerconcatMapEagerconcatMapEagerDelayErrorconcatMapEagerDelayErrorconcatMapIterableconcatMapIterableconcatMapMaybeconcatMapMaybeconcatMapMaybeDelayErrorconcatMapMaybeDelayErrorconcatMapMaybeDelayErrorconcatMapSingleconcatMapSingleconcatMapSingleDelayErrorconcatMapSingleDelayErrorconcatMapSingleDelayErrorconcatWithconcatWithconcatWithconcatWithcontainscountcreatedebouncedebouncedebouncedefaultIfEmptydeferdelaydelaydelaydelaydelaydelaydelaySubscriptiondelaySubscriptiondelaySubscriptiondematerializedematerializedistinctdistinctdistinctdistinctUntilChangeddistinctUntilChangeddistinctUntilChangeddoAfterNextdoAfterTerminatedoFinallydoOnCanceldoOnCompletedoOnEachdoOnEachdoOnErrordoOnLifecycledoOnNextdoOnRequestdoOnSubscribedoOnTerminateelementAtelementAtelementAtOrErroremptyerrorerrorfilterfirstfirstElementfirstOrErrorflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapCompletableflatMapCompletableflatMapIterableflatMapIterableflatMapIterableflatMapIterableflatMapMaybeflatMapMaybeflatMapSingleflatMapSingleforEachforEachWhileforEachWhileforEachWhilefromArrayfromCallablefromFuturefromFuturefromFuturefromFuturefromIterablefromPublishergenerategenerategenerategenerategenerategroupBygroupBygroupBygroupBygroupBygroupBygroupJoinhideignoreElementsintervalintervalintervalintervalintervalRangeintervalRangeisEmptyjoinjustjustjustjustjustjustjustjustjustjustlastlastElementlastOrErrorliftlimitmapmaterializemergemergemergemergemergemergemergemergemergeArraymergeArraymergeArrayDelayErrormergeArrayDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeWithmergeWithmergeWithmergeWithneverobserveOnobserveOnobserveOnofTypeonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureDroponBackpressureDroponBackpressureLatestonErrorResumeNextonErrorResumeNextonErrorReturnonErrorReturnItemonExceptionResumeNextonTerminateDetachparallelparallelparallelpublishpublishpublishpublishrangerangeLongrebatchRequestsreducereducereduceWithrepeatrepeatrepeatUntilrepeatWhenreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayretryretryretryretryretryretryUntilretryWhensafeSubscribesamplesamplesamplesamplesamplesamplescanscanscanWithsequenceEqualsequenceEqualsequenceEqualsequenceEqualserializesharesinglesingleElementsingleOrErrorskipskipskipskipLastskipLastskipLastskipLastskipLastskipLastskipUntilskipWhilesortedsortedstartWithstartWithstartWithstartWithArraysubscribesubscribesubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeOnsubscribeWithswitchIfEmptyswitchMapswitchMapswitchMapCompletableswitchMapCompletableDelayErrorswitchMapDelayErrorswitchMapDelayErrorswitchMapMaybeswitchMapMaybeDelayErrorswitchMapSingleswitchMapSingleDelayErrorswitchOnNextswitchOnNextswitchOnNextDelayErrorswitchOnNextDelayErrortaketaketaketakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeUntiltakeUntiltakeWhiletesttesttestthrottleFirstthrottleFirstthrottleLastthrottleLastthrottleLatestthrottleLatestthrottleLatestthrottleLatestthrottleWithTimeoutthrottleWithTimeouttimeIntervaltimeIntervaltimeIntervaltimeIntervaltimeouttimeouttimeouttimeouttimeouttimeouttimeouttimeouttimertimertimestamptimestamptimestamptimestamptotoFuturetoListtoListtoListtoMaptoMaptoMaptoMultimaptoMultimaptoMultimaptoMultimaptoObservabletoSortedListtoSortedListtoSortedListtoSortedListunsafeCreateunsubscribeOnusingusingwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwithLatestFromwithLatestFromwithLatestFromwithLatestFromwithLatestFromwithLatestFromzipzipzipzipzipzipzipzipzipzipzipzipzipArrayzipIterablezipWithzipWithzipWithzipWith

Field Detail

mapperback to summary
pack-priv final Function<? super T, ? extends Iterable<? extends R>> mapper
sourceback to summary
pack-priv final MaybeSource<T> source

Constructor Detail

MaybeFlatMapIterableFlowableback to summary
public MaybeFlatMapIterableFlowable(MaybeSource<T> source, Function<? super T, ? extends Iterable<? extends R>> mapper)

Method Detail

subscribeActualback to summary
protected void subscribeActual(Subscriber<? super R> s)

Implements abstract io.reactivex.Flowable.subscribeActual.

Doc from io.reactivex.Flowable.subscribeActual.

Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Subscribers.

There is no need to call any of the plugin hooks on the current Flowable instance or the Subscriber; all hooks and basic safeguards have been applied by subscribe(Subscriber) before this method gets called.

Parameters
s:Subscriber<? super R>

the incoming Subscriber, never null

Annotations
@Override
io.reactivex.internal.operators.maybe back to summary

pack-priv final Class MaybeFlatMapIterableFlowable.FlatMapIterableObserver<T, R>

extends BasicIntQueueSubscription<R>
implements MaybeObserver<T>
Class Inheritance
All Implemented Interfaces
io.reactivex.MaybeObserver

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv final Subscriber<? super R>
pack-priv volatile Iterator<? extends R>
pack-priv final Function<? super T, ? extends Iterable<? extends R>>
pack-priv boolean
pack-priv final AtomicLong
private static final long
pack-priv Disposable

Constructor Summary

AccessConstructor and Description
pack-priv
FlatMapIterableObserver(Subscriber<? super R> actual, Function<? super T, ? extends Iterable<? extends R>> mapper)

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
public void
clear()

Implements io.reactivex.internal.fuseable.SimpleQueue.clear.

Removes all enqueued items from this queue.
pack-priv void
pack-priv void
fastPath(Subscriber<? super R> a, Iterator<? extends R> iterator)

public boolean
isEmpty()

Implements io.reactivex.internal.fuseable.SimpleQueue.isEmpty.

Returns true if the queue is empty.
public void
onComplete()

Implements io.reactivex.MaybeObserver.onComplete.

Called once the deferred computation completes normally.
public void
onError(Throwable
the exception encountered by the Maybe
e
)

Implements io.reactivex.MaybeObserver.onError.

Notifies the MaybeObserver that the Maybe has experienced an error condition.
public void
onSubscribe(Disposable
the Disposable instance whose Disposable#dispose() can be called anytime to cancel the connection
d
)

Implements io.reactivex.MaybeObserver.onSubscribe.

Provides the MaybeObserver with the means of cancelling (disposing) the connection (channel) with the Maybe in both synchronous (from within onSubscribe(Disposable) itself) and asynchronous manner.
public void
onSuccess(T
the item emitted by the Maybe
value
)

Implements io.reactivex.MaybeObserver.onSuccess.

Notifies the MaybeObserver with one item and that the Maybe has finished sending push-based notifications.
public R
poll()

Implements io.reactivex.internal.fuseable.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.
public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
public int
requestFusion(int
the requested fusion mode, allowed values are SYNC, ASYNC, ANY combined with BOUNDARY (e.g., requestFusion(SYNC | BOUNDARY)).
mode
)

Implements io.reactivex.internal.fuseable.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.
Inherited from io.reactivex.internal.subscriptions.BasicIntQueueSubscription:
offeroffer

Field Detail

cancelledback to summary
pack-priv volatile boolean cancelled
downstreamback to summary
pack-priv final Subscriber<? super R> downstream
itback to summary
pack-priv volatile Iterator<? extends R> it
mapperback to summary
pack-priv final Function<? super T, ? extends Iterable<? extends R>> mapper
outputFusedback to summary
pack-priv boolean outputFused
requestedback to summary
pack-priv final AtomicLong requested
serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.reactivex.internal.subscriptions.BasicIntQueueSubscription.serialVersionUID.

upstreamback to summary
pack-priv Disposable upstream

Constructor Detail

FlatMapIterableObserverback to summary
pack-priv FlatMapIterableObserver(Subscriber<? super R> actual, Function<? super T, ? extends Iterable<? extends R>> mapper)

Method Detail

cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
clearback to summary
public void clear()

Implements io.reactivex.internal.fuseable.SimpleQueue.clear.

Doc from io.reactivex.internal.fuseable.SimpleQueue.clear.

Removes all enqueued items from this queue.

Annotations
@Override
drainback to summary
pack-priv void drain()
fastPathback to summary
pack-priv void fastPath(Subscriber<? super R> a, Iterator<? extends R> iterator)
isEmptyback to summary
public boolean isEmpty()

Implements io.reactivex.internal.fuseable.SimpleQueue.isEmpty.

Doc from io.reactivex.internal.fuseable.SimpleQueue.isEmpty.

Returns true if the queue is empty.

Note however that due to potential fused functions in poll() it is possible this method returns false but then poll() returns null because the fused function swallowed the available item(s).

Returns:boolean

true if the queue is empty

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements io.reactivex.MaybeObserver.onComplete.

Doc from io.reactivex.MaybeObserver.onComplete.

Called once the deferred computation completes normally.

Annotations
@Override
onErrorback to summary
public void onError(Throwable e)

Implements io.reactivex.MaybeObserver.onError.

Doc from io.reactivex.MaybeObserver.onError.

Notifies the MaybeObserver that the Maybe has experienced an error condition.

If the Maybe calls this method, it will not thereafter call onSuccess.

Parameters
e:Throwable

the exception encountered by the Maybe

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Disposable d)

Implements io.reactivex.MaybeObserver.onSubscribe.

Doc from io.reactivex.MaybeObserver.onSubscribe.

Provides the MaybeObserver with the means of cancelling (disposing) the connection (channel) with the Maybe in both synchronous (from within onSubscribe(Disposable) itself) and asynchronous manner.

Parameters
d:Disposable

the Disposable instance whose Disposable#dispose() can be called anytime to cancel the connection

Annotations
@Override
onSuccessback to summary
public void onSuccess(T value)

Implements io.reactivex.MaybeObserver.onSuccess.

Doc from io.reactivex.MaybeObserver.onSuccess.

Notifies the MaybeObserver with one item and that the Maybe has finished sending push-based notifications.

The Maybe will not call this method if it calls onError.

Parameters
value:T

the item emitted by the Maybe

Annotations
@Override
pollback to summary
public R poll() throws Exception

Implements io.reactivex.internal.fuseable.SimpleQueue.poll.

Doc from io.reactivex.internal.fuseable.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.

If the producer uses offer(Object, Object) and when polling in pairs, if the first poll() returns a non-null item, the second poll() is guaranteed to return a non-null item as well.

Returns:R

the item or null to indicate an empty queue

Annotations
@Nullable
@Override
Exceptions
Exception:
if some pre-processing of the dequeued item (usually through fused functions) throws.
requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
requestFusionback to summary
public int requestFusion(int mode)

Implements io.reactivex.internal.fuseable.QueueFuseable.requestFusion.

Doc from io.reactivex.internal.fuseable.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.

This should be called before onSubscribe returns.

Calling this method multiple times or after onSubscribe finished is not allowed and may result in undefined behavior.

Parameters
mode:int

the requested fusion mode, allowed values are SYNC, ASYNC, ANY combined with BOUNDARY (e.g., requestFusion(SYNC | BOUNDARY)).

Returns:int

the established fusion mode: NONE, SYNC, ASYNC.

Annotations
@Override