@@ -2255,12 +2255,12 @@ public final static <T> Observable<Observable<T>> parallelMerge(Observable<Obser
2255
2255
}
2256
2256
2257
2257
/**
2258
- * Pivots a sequence of GroupedObservables emitted by an Observable so as to swap the group and and the set
2259
- * on which their items are grouped.
2258
+ * Pivots a sequence of {@code GroupedObservable}s emitted by an {@code Observable} so as to swap the group
2259
+ * and and the set on which their items are grouped.
2260
2260
* <p>
2261
2261
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/pivot.png">
2262
2262
*
2263
- * For example an Observable such as this =>
2263
+ * For example an {@code Observable} such as this =>
2264
2264
*
2265
2265
* {@code Observable<GroupedObservable<String, GroupedObservable<Boolean, Integer>>>}:
2266
2266
* <ul>
@@ -2280,10 +2280,16 @@ public final static <T> Observable<Observable<T>> parallelMerge(Observable<Obser
2280
2280
* </ul>
2281
2281
* <p>
2282
2282
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/pivot.ex.png">
2283
+ * <p>
2284
+ * <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
2285
+ * is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
2286
+ * {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
2287
+ * discard their buffers by applying an operator like {@link #take}{@code (0)} to them.
2283
2288
*
2284
2289
* @param groups
2285
2290
the {@link GroupedObservable} to pivot
2286
- * @return an Observable containing a stream of nested GroupedObservables with swapped inner-outer keys.
2291
+ * @return an {@code Observable} containing a stream of nested {@code GroupedObservable}s with swapped
2292
+ * inner-outer keys.
2287
2293
* @since 0.17
2288
2294
*/
2289
2295
public static final <K1 , K2 , T > Observable <GroupedObservable <K2 , GroupedObservable <K1 , T >>> pivot (Observable <GroupedObservable <K1 , GroupedObservable <K2 , T >>> groups ) {
@@ -4027,36 +4033,47 @@ public final void forEach(final Action1<? super T> onNext, final Action1<Throwab
4027
4033
}
4028
4034
4029
4035
/**
4030
- * Groups the items emitted by an Observable according to a specified criterion, and emits these grouped
4031
- * items as {@link GroupedObservable}s, one {@code GroupedObservable} per group.
4036
+ * Groups the items emitted by an {@code Observable} according to a specified criterion, and emits these
4037
+ * grouped items as {@link GroupedObservable}s, one {@code GroupedObservable} per group.
4032
4038
* <p>
4033
4039
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/groupBy.png">
4040
+ * <p>
4041
+ * <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
4042
+ * is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
4043
+ * {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
4044
+ * discard their buffers by applying an operator like {@link #take}{@code (0)} to them.
4034
4045
*
4035
4046
* @param keySelector
4036
4047
* a function that extracts the key for each item
4037
4048
* @param <K>
4038
4049
* the key type
4039
- * @return an Observable that emits {@link GroupedObservable}s, each of which corresponds to a unique key
4040
- * value and each of which emits those items from the source Observable that share that key value
4050
+ * @return an {@code Observable} that emits {@link GroupedObservable}s, each of which corresponds to a
4051
+ * unique key value and each of which emits those items from the source Observable that share that
4052
+ * key value
4041
4053
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-groupby-and-groupbyuntil">RxJava Wiki: groupBy</a>
4042
4054
*/
4043
4055
public final <K > Observable <GroupedObservable <K , T >> groupBy (final Func1 <? super T , ? extends K > keySelector ) {
4044
4056
return lift (new OperatorGroupBy <K , T >(keySelector ));
4045
4057
}
4046
4058
4047
4059
/**
4048
- * Groups the items emitted by an Observable according to a specified key selector function until the
4049
- * duration Observable expires for the key.
4060
+ * Groups the items emitted by an {@code Observable} according to a specified key selector function until
4061
+ * the duration {@code Observable} expires for the key.
4050
4062
* <p>
4051
4063
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/groupByUntil.png">
4064
+ * <p>
4065
+ * <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
4066
+ * is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
4067
+ * {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
4068
+ * discard their buffers by applying an operator like {@link #take}{@code (0)} to them.
4052
4069
*
4053
4070
* @param keySelector
4054
4071
* a function to extract the key for each item
4055
4072
* @param durationSelector
4056
4073
* a function to signal the expiration of a group
4057
- * @return an Observable that emits {@link GroupedObservable}s, each of which corresponds to a key value and
4058
- * each of which emits all items emitted by the source Observable during that key's duration that
4059
- * share that same key value
4074
+ * @return an {@code Observable} that emits {@link GroupedObservable}s, each of which corresponds to a key
4075
+ * value and each of which emits all items emitted by the source {@code Observable} during that
4076
+ * key's duration that share that same key value
4060
4077
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-groupby-and-groupbyuntil">RxJava Wiki: groupByUntil()</a>
4061
4078
* @see <a href="http://msdn.microsoft.com/en-us/library/hh211932.aspx">MSDN: Observable.GroupByUntil</a>
4062
4079
*/
@@ -4065,21 +4082,26 @@ public final <TKey, TDuration> Observable<GroupedObservable<TKey, T>> groupByUnt
4065
4082
}
4066
4083
4067
4084
/**
4068
- * Groups the items emitted by an Observable (transformed by a selector) according to a specified key
4069
- * selector function until the duration Observable expires for the key.
4085
+ * Groups the items emitted by an {@code Observable} (transformed by a selector) according to a specified
4086
+ * key selector function until the duration Observable expires for the key.
4070
4087
* <p>
4071
4088
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/groupByUntil.png">
4089
+ * <p>
4090
+ * <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
4091
+ * is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
4092
+ * {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
4093
+ * discard their buffers by applying an operator like {@link #take}{@code (0)} to them.
4072
4094
*
4073
4095
* @param keySelector
4074
4096
* a function to extract the key for each item
4075
4097
* @param valueSelector
4076
- * a function to map each item emitted by the source Observable to an item emitted by one of the
4077
- * resulting {@link GroupedObservable}s
4098
+ * a function to map each item emitted by the source {@code Observable} to an item emitted by one
4099
+ * of the resulting {@link GroupedObservable}s
4078
4100
* @param durationSelector
4079
4101
* a function to signal the expiration of a group
4080
- * @return an Observable that emits {@link GroupedObservable}s, each of which corresponds to a key value and
4081
- * each of which emits all items emitted by the source Observable during that key's duration that
4082
- * share that same key value, transformed by the value selector
4102
+ * @return an {@code Observable} that emits {@link GroupedObservable}s, each of which corresponds to a key
4103
+ * value and each of which emits all items emitted by the source {@code Observable} during that
4104
+ * key's duration that share that same key value, transformed by the value selector
4083
4105
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-groupby-and-groupbyuntil">RxJava Wiki: groupByUntil()</a>
4084
4106
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229433.aspx">MSDN: Observable.GroupByUntil</a>
4085
4107
*/
0 commit comments