Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OperatorGroupBy<T, K, V>

extends Object
implements Observable.Operator<GroupedObservable<K, V>, T>
Class Inheritance
All Implemented Interfaces
rx.Observable.Operator, rx.functions.Func1, rx.functions.Function
Annotations
@Deprecated
Type Parameters
<T>
the source and group value type
<K>
the key type
<V>
the value type of the groups
Imports
java.util.*, java.util.concurrent.*, java.util.concurrent.atomic.*, rx.*, rx.Observable.*, rx.exceptions.Exceptions, rx.functions.*, rx.internal.producers.ProducerArbiter, rx.internal.util.*, rx.observables.GroupedObservable, rx.observers.Subscribers, rx.plugins.RxJavaHooks, rx.subscriptions.Subscriptions

Deprecated

since 1.3.7, use OperatorGroupByEvicting instead

Groups the items emitted by an Observable according to a specified criterion, and emits these grouped items as Observables, one Observable per group.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final boolean
pack-priv final Func1<? super T, ? extends K>
pack-priv final Func1<Action1<K>, Map<K, Object>>
pack-priv final Func1<? super T, ? extends V>

Constructor Summary

AccessConstructor and Description
public
OperatorGroupBy(Func1<? super T, ? extends K> keySelector)

public
OperatorGroupBy(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector)

public
OperatorGroupBy(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func1<Action1<K>, Map<K, Object>> mapFactory)

public
OperatorGroupBy(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Func1<Action1<K>, Map<K, Object>> mapFactory)

Method Summary

Modifier and TypeMethod and Description
public Subscriber<? super T>
call(Subscriber<? super GroupedObservable<K, V>> child)

Implements rx.functions.Func1.call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferSizeback to summary
pack-priv final int bufferSize
delayErrorback to summary
pack-priv final boolean delayError
keySelectorback to summary
pack-priv final Func1<? super T, ? extends K> keySelector
mapFactoryback to summary
pack-priv final Func1<Action1<K>, Map<K, Object>> mapFactory
valueSelectorback to summary
pack-priv final Func1<? super T, ? extends V> valueSelector

Constructor Detail

OperatorGroupByback to summary
public OperatorGroupBy(Func1<? super T, ? extends K> keySelector)
Annotations
@SuppressWarnings:unchecked, rawtypes
OperatorGroupByback to summary
public OperatorGroupBy(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector)
OperatorGroupByback to summary
public OperatorGroupBy(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func1<Action1<K>, Map<K, Object>> mapFactory)
OperatorGroupByback to summary
public OperatorGroupBy(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Func1<Action1<K>, Map<K, Object>> mapFactory)

Method Detail

callback to summary
public Subscriber<? super T> call(Subscriber<? super GroupedObservable<K, V>> child)

Implements rx.functions.Func1.call.

Annotations
@Override
rx.internal.operators back to summary

public final Class OperatorGroupBy.GroupByProducer

extends Object
implements Producer
Class Inheritance
All Implemented Interfaces
rx.Producer

Field Summary

Modifier and TypeField and Description
pack-priv final OperatorGroupBy.GroupBySubscriber<?, ?, ?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
request(long
the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace
n
)

Implements rx.Producer.request.

Request a certain maximum number of items from this Producer.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parentback to summary
pack-priv final OperatorGroupBy.GroupBySubscriber<?, ?, ?> parent

Constructor Detail

GroupByProducerback to summary
public GroupByProducer(OperatorGroupBy.GroupBySubscriber<?, ?, ?> parent)

Method Detail

requestback to summary
public void request(long n)

Implements rx.Producer.request.

Doc from rx.Producer.request.

Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

request(100);
request(Long.MAX_VALUE-1);
Parameters
n:long

the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace

Annotations
@Override
rx.internal.operators back to summary

public final Class OperatorGroupBy.GroupBySubscriber<T, K, V>

extends Subscriber<T>
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final Subscriber<? super GroupedObservable<K, V>>
pack-priv final int
pack-priv final AtomicBoolean
pack-priv final boolean
pack-priv volatile boolean
pack-priv Throwable
pack-priv final Queue<K>
pack-priv final AtomicInteger
pack-priv final Map<Object, OperatorGroupBy.GroupedUnicast<K, V>>
pack-priv final Map<Object, OperatorGroupBy.GroupedUnicast<K, V>>
pack-priv final Func1<? super T, ? extends K>
pack-priv static final Object
pack-priv final OperatorGroupBy.GroupByProducer
pack-priv final Queue<GroupedObservable<K, V>>
pack-priv final AtomicLong
pack-priv final ProducerArbiter
s

pack-priv final Func1<? super T, ? extends V>
pack-priv final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
GroupBySubscriber(Subscriber<? super GroupedObservable<K, V>> actual, Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Func1<Action1<K>, Map<K, Object>> mapFactory)

Method Summary

Modifier and TypeMethod and Description
public void
public void
cancel(K key)

pack-priv boolean
checkTerminated(boolean d, boolean empty, Subscriber<? super GroupedObservable<K, V>> a, Queue<?> q)

private Map<Object, OperatorGroupBy.GroupedUnicast<K, V>>
createMap(Func1<Action1<K>, Map<K, Object>> mapFactory, Action1<K> evictionAction)

pack-priv void
pack-priv void
errorAll(Subscriber<? super GroupedObservable<K, V>> a, Queue<?> q, Throwable ex)

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
t
)

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.
public void
requestMore(long n)

public void
setProducer(Producer
producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from
s
)

Overrides rx.Subscriber.setProducer.

If other subscriber is set (by calling constructor Subscriber(Subscriber) or Subscriber(Subscriber, boolean)) then this method calls setProducer on the other subscriber.
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestunsubscribe

Field Detail

actualback to summary
pack-priv final Subscriber<? super GroupedObservable<K, V>> actual
bufferSizeback to summary
pack-priv final int bufferSize
cancelledback to summary
pack-priv final AtomicBoolean cancelled
delayErrorback to summary
pack-priv final boolean delayError
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv Throwable error
evictedKeysback to summary
pack-priv final Queue<K> evictedKeys
groupCountback to summary
pack-priv final AtomicInteger groupCount
groupsback to summary
pack-priv final Map<Object, OperatorGroupBy.GroupedUnicast<K, V>> groups
groupsCopyback to summary
pack-priv final Map<Object, OperatorGroupBy.GroupedUnicast<K, V>> groupsCopy
keySelectorback to summary
pack-priv final Func1<? super T, ? extends K> keySelector
NULL_KEYback to summary
pack-priv static final Object NULL_KEY
producerback to summary
pack-priv final OperatorGroupBy.GroupByProducer producer

Hides rx.Subscriber.producer.

queueback to summary
pack-priv final Queue<GroupedObservable<K, V>> queue
requestedback to summary
pack-priv final AtomicLong requested

Hides rx.Subscriber.requested.

sback to summary
pack-priv final ProducerArbiter s
valueSelectorback to summary
pack-priv final Func1<? super T, ? extends V> valueSelector
wipback to summary
pack-priv final AtomicInteger wip

Constructor Detail

GroupBySubscriberback to summary
public GroupBySubscriber(Subscriber<? super GroupedObservable<K, V>> actual, Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, int bufferSize, boolean delayError, Func1<Action1<K>, Map<K, Object>> mapFactory)

Method Detail

cancelback to summary
public void cancel()
cancelback to summary
public void cancel(K key)
checkTerminatedback to summary
pack-priv boolean checkTerminated(boolean d, boolean empty, Subscriber<? super GroupedObservable<K, V>> a, Queue<?> q)
createMapback to summary
private Map<Object, OperatorGroupBy.GroupedUnicast<K, V>> createMap(Func1<Action1<K>, Map<K, Object>> mapFactory, Action1<K> evictionAction)
Annotations
@SuppressWarnings:unchecked
drainback to summary
pack-priv void drain()
errorAllback to summary
pack-priv void errorAll(Subscriber<? super GroupedObservable<K, V>> a, Queue<?> q, Throwable ex)
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 t)

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
t: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
public void requestMore(long n)
setProducerback to summary
public void setProducer(Producer s)

Overrides rx.Subscriber.setProducer.

Doc from rx.Subscriber.setProducer.

If other subscriber is set (by calling constructor Subscriber(Subscriber) or Subscriber(Subscriber, boolean)) then this method calls setProducer on the other subscriber. If the other subscriber is not set and no requests have been made to this subscriber then p.request(Long.MAX_VALUE) is called. If the other subscriber is not set and some requests have been made to this subscriber then p.request(n) is called where n is the accumulated requests to this subscriber.

Parameters
s:Producer

producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from

Annotations
@Override
rx.internal.operators back to summary

pack-priv Class OperatorGroupBy.GroupBySubscriber.EvictionAction<K>

extends Object
implements Action1<K>
Class Inheritance
  • java.lang.Object
  • rx.internal.operators.OperatorGroupBy.GroupBySubscriber.EvictionAction
All Implemented Interfaces
rx.functions.Action1, rx.functions.Action, rx.functions.Function

Field Summary

Modifier and TypeField and Description
pack-priv final Queue<K>

Constructor Summary

AccessConstructor and Description
pack-priv
EvictionAction(Queue<K> evictedKeys)

Method Summary

Modifier and TypeMethod and Description
public void
call(K key)

Implements rx.functions.Action1.call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

evictedKeysback to summary
pack-priv final Queue<K> evictedKeys

Constructor Detail

EvictionActionback to summary
pack-priv EvictionAction(Queue<K> evictedKeys)

Method Detail

callback to summary
public void call(K key)

Implements rx.functions.Action1.call.

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class OperatorGroupBy.GroupedUnicast<K, T>

extends GroupedObservable<K, T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final OperatorGroupBy.State<T, K>

Constructor Summary

AccessConstructor and Description
protected
GroupedUnicast(K key, OperatorGroupBy.State<T, K> state)

Method Summary

Modifier and TypeMethod and Description
public static <T, K> OperatorGroupBy.GroupedUnicast<K, T>
createWith(K key, int bufferSize, OperatorGroupBy.GroupBySubscriber<?, K, T> parent, boolean delayError)

public void
public void
public void
onNext(T t)

Inherited from rx.observables.GroupedObservable:
createfromgetKey

Field Detail

stateback to summary
pack-priv final OperatorGroupBy.State<T, K> state

Constructor Detail

GroupedUnicastback to summary
protected GroupedUnicast(K key, OperatorGroupBy.State<T, K> state)

Method Detail

createWithback to summary
public static <T, K> OperatorGroupBy.GroupedUnicast<K, T> createWith(K key, int bufferSize, OperatorGroupBy.GroupBySubscriber<?, K, T> parent, boolean delayError)
onCompleteback to summary
public void onComplete()
onErrorback to summary
public void onError(Throwable e)
onNextback to summary
public void onNext(T t)
rx.internal.operators back to summary

pack-priv final Class OperatorGroupBy.State<T, K>

extends AtomicInteger
implements Producer, Subscription, Observable.OnSubscribe<T>
Class Inheritance
All Implemented Interfaces
rx.Observable.OnSubscribe, rx.functions.Action1, rx.functions.Action, rx.functions.Function, rx.Subscription, rx.Producer

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicReference<Subscriber<? super T>>
pack-priv final AtomicBoolean
pack-priv final boolean
pack-priv volatile boolean
pack-priv Throwable
pack-priv final K
pack-priv final AtomicBoolean
pack-priv final OperatorGroupBy.GroupBySubscriber<?, K, T>
pack-priv final Queue<Object>
pack-priv final AtomicLong
private static final long

Constructor Summary

AccessConstructor and Description
public
State(int bufferSize, OperatorGroupBy.GroupBySubscriber<?, K, T> parent, K key, boolean delayError)

Method Summary

Modifier and TypeMethod and Description
public void
call(Subscriber<? super T> s)

Implements rx.functions.Action1.call.

pack-priv boolean
checkTerminated(boolean d, boolean empty, Subscriber<? super T> a, boolean delayError)

pack-priv void
public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
public void
public void
public void
onNext(T t)

public void
request(long
the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace
n
)

Implements rx.Producer.request.

Request a certain maximum number of items from this Producer.
public void
unsubscribe()

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
Inherited from java.util.concurrent.atomic.AtomicInteger:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

actualback to summary
pack-priv final AtomicReference<Subscriber<? super T>> actual
cancelledback to summary
pack-priv final AtomicBoolean cancelled
delayErrorback to summary
pack-priv final boolean delayError
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv Throwable error
keyback to summary
pack-priv final K key
onceback to summary
pack-priv final AtomicBoolean once
parentback to summary
pack-priv final OperatorGroupBy.GroupBySubscriber<?, K, T> parent
queueback to summary
pack-priv final Queue<Object> queue
requestedback to summary
pack-priv final AtomicLong requested
serialVersionUIDback to summary
private static final long serialVersionUID

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

Constructor Detail

Stateback to summary
public State(int bufferSize, OperatorGroupBy.GroupBySubscriber<?, K, T> parent, K key, boolean delayError)

Method Detail

callback to summary
public void call(Subscriber<? super T> s)

Implements rx.functions.Action1.call.

Annotations
@Override
checkTerminatedback to summary
pack-priv boolean checkTerminated(boolean d, boolean empty, Subscriber<? super T> a, boolean delayError)
drainback to summary
pack-priv void drain()
isUnsubscribedback to summary
public boolean isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Doc from rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.

Returns:boolean

true if this Subscription is currently unsubscribed, false otherwise

Annotations
@Override
onCompleteback to summary
public void onComplete()
onErrorback to summary
public void onError(Throwable e)
onNextback to summary
public void onNext(T t)
requestback to summary
public void request(long n)

Implements rx.Producer.request.

Doc from rx.Producer.request.

Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

request(100);
request(Long.MAX_VALUE-1);
Parameters
n:long

the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace

Annotations
@Override
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Doc from rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.

This allows deregistering an Subscriber before it has finished receiving all events (i.e. before onCompleted is called).

Annotations
@Override