Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OnSubscribeFlattenIterable<T, R>

extends Object
implements Observable.OnSubscribe<R>
Class Inheritance
All Implemented Interfaces
rx.Observable.OnSubscribe, rx.functions.Action1, rx.functions.Action, rx.functions.Function
Type Parameters
<T>
the input value type
<R>
the output value type
Imports
java.util.*, java.util.concurrent.atomic.*, rx.*, .Observable, .Observable.OnSubscribe, rx.exceptions.*, rx.functions.Func1, rx.internal.util.*, rx.internal.util.atomic.*, rx.internal.util.unsafe.*, rx.plugins.RxJavaHooks

Flattens a sequence if Iterable sources, generated via a function, into a single sequence.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
OnSubscribeFlattenIterable.OnSubscribeScalarFlattenIterable<
the scalar's value type
T
,
the result value type
R
>

A custom flattening operator that works from a scalar value and computes the iterable during subscription time.

Field Summary

Modifier and TypeField and Description
pack-priv final Func1<? super T, ? extends Iterable<? extends R>>
pack-priv final int
pack-priv final Observable<? extends T>

Constructor Summary

AccessConstructor and Description
protected
OnSubscribeFlattenIterable(Observable<? extends T> source, Func1<? super T, ? extends Iterable<? extends R>> mapper, int prefetch)

Protected: use createFrom to handle source-dependent optimizations.

Method Summary

Modifier and TypeMethod and Description
public void
call(Subscriber<? super R> t)

Implements rx.functions.Action1.call.

public static <T, R> Observable<R>
createFrom(Observable<? extends T> source, Func1<? super T, ? extends Iterable<? extends R>> mapper, int prefetch)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapperback to summary
pack-priv final Func1<? super T, ? extends Iterable<? extends R>> mapper
prefetchback to summary
pack-priv final int prefetch
sourceback to summary
pack-priv final Observable<? extends T> source

Constructor Detail

OnSubscribeFlattenIterableback to summary
protected OnSubscribeFlattenIterable(Observable<? extends T> source, Func1<? super T, ? extends Iterable<? extends R>> mapper, int prefetch)

Protected: use createFrom to handle source-dependent optimizations.

Method Detail

callback to summary
public void call(Subscriber<? super R> t)

Implements rx.functions.Action1.call.

Annotations
@Override
createFromback to summary
public static <T, R> Observable<R> createFrom(Observable<? extends T> source, Func1<? super T, ? extends Iterable<? extends R>> mapper, int prefetch)
rx.internal.operators back to summary

pack-priv final Class OnSubscribeFlattenIterable.FlattenIterableSubscriber<T, R>

extends Subscriber<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv Iterator<? extends R>
pack-priv final Subscriber<? super R>
pack-priv volatile boolean
pack-priv final AtomicReference<Throwable>
pack-priv final long
pack-priv final Func1<? super T, ? extends Iterable<? extends R>>
pack-priv long
pack-priv final Queue<Object>
pack-priv final AtomicLong
pack-priv final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
FlattenIterableSubscriber(Subscriber<? super R> actual, Func1<? super T, ? extends Iterable<? extends R>> mapper, int prefetch)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
checkTerminated(boolean d, boolean empty, Subscriber<?> a, Queue<?> q)

pack-priv void
public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
onError(Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.
public void
onNext(T
the item emitted by the Observable
t
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
pack-priv void
requestMore(long n)

Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

activeback to summary
pack-priv Iterator<? extends R> active
actualback to summary
pack-priv final Subscriber<? super R> actual
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv final AtomicReference<Throwable> error
limitback to summary
pack-priv final long limit
mapperback to summary
pack-priv final Func1<? super T, ? extends Iterable<? extends R>> mapper
producedback to summary
pack-priv long produced
queueback to summary
pack-priv final Queue<Object> queue
requestedback to summary
pack-priv final AtomicLong requested

Hides rx.Subscriber.requested.

wipback to summary
pack-priv final AtomicInteger wip

Constructor Detail

FlattenIterableSubscriberback to summary
public FlattenIterableSubscriber(Subscriber<? super R> actual, Func1<? super T, ? extends Iterable<? extends R>> mapper, int prefetch)

Method Detail

checkTerminatedback to summary
pack-priv boolean checkTerminated(boolean d, boolean empty, Subscriber<?> a, Queue<?> q)
drainback to summary
pack-priv void drain()
onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.

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

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

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements rx.Observer.onNext.

Doc from rx.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
requestMoreback to summary
pack-priv void requestMore(long n)
rx.internal.operators back to summary

pack-priv final Class OnSubscribeFlattenIterable.OnSubscribeScalarFlattenIterable<T, R>

extends Object
implements Observable.OnSubscribe<R>
Class Inheritance
  • java.lang.Object
  • rx.internal.operators.OnSubscribeFlattenIterable.OnSubscribeScalarFlattenIterable
All Implemented Interfaces
rx.Observable.OnSubscribe, rx.functions.Action1, rx.functions.Action, rx.functions.Function
Type Parameters
<T>
the scalar's value type
<R>
the result value type

A custom flattening operator that works from a scalar value and computes the iterable during subscription time.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
OnSubscribeScalarFlattenIterable(T value, Func1<? super T, ? extends Iterable<? extends R>> mapper)

Method Summary

Modifier and TypeMethod and Description
public void
call(Subscriber<? super R> t)

Implements rx.functions.Action1.call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

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

Constructor Detail

OnSubscribeScalarFlattenIterableback to summary
public OnSubscribeScalarFlattenIterable(T value, Func1<? super T, ? extends Iterable<? extends R>> mapper)

Method Detail

callback to summary
public void call(Subscriber<? super R> t)

Implements rx.functions.Action1.call.

Annotations
@Override