Top Description Inners Constructors Methods
io.reactivex.rxjava3.internal.operators.observable

public final Class ObservableScalarXMap

extends Object
Class Inheritance
Imports
java.util.Objects, java.util.concurrent.atomic.AtomicInteger, io.reactivex.rxjava3.annotations.Nullable, io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.exceptions.Exceptions, io.reactivex.rxjava3.functions.*, io.reactivex.rxjava3.internal.disposables.EmptyDisposable, io.reactivex.rxjava3.operators.QueueDisposable, io.reactivex.rxjava3.plugins.RxJavaPlugins

Utility classes to work with scalar-sourced XMap operators (where X == { flat, concat, switch }).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ObservableScalarXMap.ScalarDisposable<
the value type
T
>

Represents a Disposable that signals one onNext followed by an onComplete.

pack-priv static class
ObservableScalarXMap.ScalarXMapObservable<
the scalar value type
T
,
the mapped ObservableSource's element type.
R
>

Maps a scalar value to an ObservableSource and subscribes to it.

Constructor Summary

AccessConstructor and Description
private
ObservableScalarXMap()

Utility class.

Method Summary

Modifier and TypeMethod and Description
public static <
the scalar value type
T
,
the output value type
U
>
Observable<U>

Returns:

the new Observable instance
scalarXMap
(T
the scalar value to map
value
,
Function<? super T, ? extends ObservableSource<? extends U>>
the function that gets the scalar value and should return an ObservableSource that gets streamed
mapper
)

Maps a scalar value into an Observable and emits its values.

public static <
the input value type
T
,
the output value type
R
>
boolean

Returns:

true if successful, false if the caller should continue with the regular path.
tryScalarXMapSubscribe
(ObservableSource<T>
the source ObservableSource
source
,
Observer<? super R>
the subscriber
observer
,
Function<? super T, ? extends ObservableSource<? extends R>>
the function mapping a scalar value into an ObservableSource
mapper
)

Tries to subscribe to a possibly Supplier source's mapped ObservableSource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ObservableScalarXMapback to summary
private ObservableScalarXMap()

Utility class.

Method Detail

scalarXMapback to summary
public static <T, U> Observable<U> scalarXMap(T value, Function<? super T, ? extends ObservableSource<? extends U>> mapper)

Maps a scalar value into an Observable and emits its values.

Parameters
<T>
the scalar value type
<U>
the output value type
value:T

the scalar value to map

mapper:Function<? super T, ? extends ObservableSource<? extends U>>

the function that gets the scalar value and should return an ObservableSource that gets streamed

Returns:Observable<U>

the new Observable instance

tryScalarXMapSubscribeback to summary
public static <T, R> boolean tryScalarXMapSubscribe(ObservableSource<T> source, Observer<? super R> observer, Function<? super T, ? extends ObservableSource<? extends R>> mapper)

Tries to subscribe to a possibly Supplier source's mapped ObservableSource.

Parameters
<T>
the input value type
<R>
the output value type
source:ObservableSource<T>

the source ObservableSource

observer:Observer<? super R>

the subscriber

mapper:Function<? super T, ? extends ObservableSource<? extends R>>

the function mapping a scalar value into an ObservableSource

Returns:boolean

true if successful, false if the caller should continue with the regular path.

Annotations
@SuppressWarnings:unchecked
io.reactivex.rxjava3.internal.operators.observable back to summary

public final Class ObservableScalarXMap.ScalarDisposable<T>

extends AtomicInteger
implements QueueDisposable<T>, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, io.reactivex.rxjava3.operators.QueueDisposable, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.operators.QueueFuseable, io.reactivex.rxjava3.operators.SimpleQueue
Type Parameters
<T>
the value type

Represents a Disposable that signals one onNext followed by an onComplete.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv final Observer<? super T>
pack-priv static final int
pack-priv static final int
private static final long
pack-priv static final int
pack-priv final T

Constructor Summary

AccessConstructor and Description
public
ScalarDisposable(Observer<? super T> observer, T value)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements io.reactivex.rxjava3.operators.SimpleQueue.clear.

Removes all enqueued items from this queue.
public void
dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.
public boolean
isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.
public boolean
isEmpty()

Implements io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Returns true if the queue is empty.
public boolean
offer(T
the value to enqueue, not null
value
)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue a single value.
public boolean
offer(T
the first value to enqueue, not null
v1
,
T
the second value to enqueue, not null
v2
)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue two values.
public T
poll()

Implements io.reactivex.rxjava3.operators.SimpleQueue.poll.

Tries to dequeue a value (non-null) or returns null if the queue is empty.
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.rxjava3.operators.QueueFuseable.requestFusion.

Request a fusion mode from the upstream.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.util.concurrent.atomic.AtomicInteger:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

FUSEDback to summary
pack-priv static final int FUSED
observerback to summary
pack-priv final Observer<? super T> observer
ON_COMPLETEback to summary
pack-priv static final int ON_COMPLETE
ON_NEXTback to summary
pack-priv static final int ON_NEXT
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicInteger.serialVersionUID.

STARTback to summary
pack-priv static final int START
valueback to summary
pack-priv final T value

Hides java.util.concurrent.atomic.AtomicInteger.value.

Constructor Detail

ScalarDisposableback to summary
public ScalarDisposable(Observer<? super T> observer, T value)

Method Detail

clearback to summary
public void clear()

Implements io.reactivex.rxjava3.operators.SimpleQueue.clear.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.clear.

Removes all enqueued items from this queue.

Annotations
@Override
disposeback to summary
public void dispose()

Implements io.reactivex.rxjava3.disposables.Disposable.dispose.

Doc from io.reactivex.rxjava3.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.

Annotations
@Override
isDisposedback to summary
public boolean isDisposed()

Implements io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Doc from io.reactivex.rxjava3.disposables.Disposable.isDisposed.

Returns true if this resource has been disposed.

Returns:boolean

true if this resource has been disposed

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements io.reactivex.rxjava3.operators.SimpleQueue.isEmpty.

Doc from io.reactivex.rxjava3.operators.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
offerback to summary
public boolean offer(T value)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue a single value.

Parameters
value:T

the value to enqueue, not null

Returns:boolean

true if successful, false if the value was not enqueued likely due to reaching the queue capacity)

Annotations
@Override
offerback to summary
public boolean offer(T v1, T v2)

Implements io.reactivex.rxjava3.operators.SimpleQueue.offer.

Doc from io.reactivex.rxjava3.operators.SimpleQueue.offer.

Atomically enqueue two values.

Parameters
v1:T

the first value to enqueue, not null

v2:T

the second value to enqueue, not null

Returns:boolean

true if successful, false if the value was not enqueued likely due to reaching the queue capacity)

Annotations
@Override
pollback to summary
public T poll()

Implements io.reactivex.rxjava3.operators.SimpleQueue.poll.

Doc from io.reactivex.rxjava3.operators.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:T

the item or null to indicate an empty queue

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

Implements io.reactivex.rxjava3.operators.QueueFuseable.requestFusion.

Doc from io.reactivex.rxjava3.operators.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
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
io.reactivex.rxjava3.internal.operators.observable back to summary

pack-priv final Class ObservableScalarXMap.ScalarXMapObservable<T, R>

extends Observable<R>
Class Inheritance
Type Parameters
<T>
the scalar value type
<R>
the mapped ObservableSource's element type.

Maps a scalar value to an ObservableSource and subscribes to it.

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
ScalarXMapObservable(T value, Function<? super T, ? extends ObservableSource<? extends R>> mapper)

Method Summary

Modifier and TypeMethod and Description
public void
subscribeActual(Observer<? super R> observer)

Inherited from io.reactivex.rxjava3.core.Observable:
allambambArrayambWithanyblockingFirstblockingFirstblockingForEachblockingForEachblockingIterableblockingIterableblockingLastblockingLastblockingLatestblockingMostRecentblockingNextblockingSingleblockingSingleblockingStreamblockingStreamblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribeblockingSubscribebufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferSizecachecacheWithInitialCapacitycastcollectcollectcollectIntocombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestArraycombineLatestArraycombineLatestArrayDelayErrorcombineLatestArrayDelayErrorcombineLatestDelayErrorcombineLatestDelayErrorcomposeconcatconcatconcatconcatconcatconcatconcatArrayconcatArrayDelayErrorconcatArrayEagerconcatArrayEagerconcatArrayEagerDelayErrorconcatArrayEagerDelayErrorconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatEagerconcatEagerconcatEagerconcatEagerconcatEagerDelayErrorconcatEagerDelayErrorconcatEagerDelayErrorconcatEagerDelayErrorconcatMapconcatMapconcatMapconcatMapCompletableconcatMapCompletableconcatMapCompletableDelayErrorconcatMapCompletableDelayErrorconcatMapCompletableDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapEagerconcatMapEagerconcatMapEagerDelayErrorconcatMapEagerDelayErrorconcatMapIterableconcatMapMaybeconcatMapMaybeconcatMapMaybeDelayErrorconcatMapMaybeDelayErrorconcatMapMaybeDelayErrorconcatMapSingleconcatMapSingleconcatMapSingleDelayErrorconcatMapSingleDelayErrorconcatMapSingleDelayErrorconcatMapStreamconcatWithconcatWithconcatWithconcatWithcontainscountcreatedebouncedebouncedebouncedebouncedefaultIfEmptydeferdelaydelaydelaydelaydelaydelaydelaySubscriptiondelaySubscriptiondelaySubscriptiondematerializedistinctdistinctdistinctdistinctUntilChangeddistinctUntilChangeddistinctUntilChangeddoAfterNextdoAfterTerminatedoFinallydoOnCompletedoOnDisposedoOnEachdoOnEachdoOnErrordoOnLifecycledoOnNextdoOnSubscribedoOnTerminateelementAtelementAtelementAtOrErroremptyerrorerrorfilterfirstfirstElementfirstOrErrorfirstOrErrorStagefirstStageflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapflatMapCompletableflatMapCompletableflatMapIterableflatMapIterableflatMapMaybeflatMapMaybeflatMapSingleflatMapSingleflatMapStreamforEachforEachWhileforEachWhileforEachWhilefromActionfromArrayfromCallablefromCompletablefromCompletionStagefromFuturefromFuturefromIterablefromMaybefromOptionalfromPublisherfromRunnablefromSinglefromStreamfromSuppliergenerategenerategenerategenerategenerategroupBygroupBygroupBygroupBygroupBygroupJoinhideignoreElementsintervalintervalintervalintervalintervalRangeintervalRangeisEmptyjoinjustjustjustjustjustjustjustjustjustjustlastlastElementlastOrErrorlastOrErrorStagelastStageliftmapmapOptionalmaterializemergemergemergemergemergemergemergemergemergeArraymergeArraymergeArrayDelayErrormergeArrayDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeWithmergeWithmergeWithmergeWithneverobserveOnobserveOnobserveOnofTypeonErrorCompleteonErrorCompleteonErrorResumeNextonErrorResumeWithonErrorReturnonErrorReturnItemonTerminateDetachpublishpublishrangerangeLongreducereducereduceWithrepeatrepeatrepeatUntilrepeatWhenreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayreplayretryretryretryretryretryretryUntilretryWhensafeSubscribesamplesamplesamplesamplesamplesamplesamplescanscanscanWithsequenceEqualsequenceEqualsequenceEqualsequenceEqualserializesharesinglesingleElementsingleOrErrorsingleOrErrorStagesingleStageskipskipskipskipLastskipLastskipLastskipLastskipLastskipLastskipUntilskipWhilesortedsortedstartWithstartWithstartWithstartWithstartWithArraystartWithItemstartWithIterablesubscribesubscribesubscribesubscribesubscribesubscribesubscribeActualsubscribeOnsubscribeWithswitchIfEmptyswitchMapswitchMapswitchMapCompletableswitchMapCompletableDelayErrorswitchMapDelayErrorswitchMapDelayErrorswitchMapMaybeswitchMapMaybeDelayErrorswitchMapSingleswitchMapSingleDelayErrorswitchOnNextswitchOnNextswitchOnNextDelayErrorswitchOnNextDelayErrortaketaketaketakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeLasttakeUntiltakeUntiltakeWhiletesttestthrottleFirstthrottleFirstthrottleFirstthrottleLastthrottleLastthrottleLastthrottleLatestthrottleLatestthrottleLatestthrottleLatestthrottleLatestthrottleWithTimeoutthrottleWithTimeoutthrottleWithTimeouttimeIntervaltimeIntervaltimeIntervaltimeIntervaltimeouttimeouttimeouttimeouttimeouttimeouttimeouttimeouttimertimertimestamptimestamptimestamptimestamptotoFlowabletoFuturetoListtoListtoListtoMaptoMaptoMaptoMultimaptoMultimaptoMultimaptoMultimaptoSortedListtoSortedListtoSortedListtoSortedListunsafeCreateunsubscribeOnusingusingwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwindowwithLatestFromwithLatestFromwithLatestFromwithLatestFromwithLatestFromwithLatestFromwrapzipzipzipzipzipzipzipzipzipzipzipzipzipArrayzipWithzipWithzipWithzipWith

Field Detail

mapperback to summary
pack-priv final Function<? super T, ? extends ObservableSource<? extends R>> mapper
valueback to summary
pack-priv final T value

Constructor Detail

ScalarXMapObservableback to summary
pack-priv ScalarXMapObservable(T value, Function<? super T, ? extends ObservableSource<? extends R>> mapper)

Method Detail

subscribeActualback to summary
public void subscribeActual(Observer<? super R> observer)
Annotations
@SuppressWarnings:unchecked
@Override