Skip to content

Commit

Permalink
added javadoc comments to Observable.distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhofer committed Sep 12, 2013
1 parent 36e6c31 commit 243e624
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions rxjava-core/src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2926,10 +2926,26 @@ public Observable<T> filter(Func1<? super T, Boolean> predicate) {
return create(OperationFilter.filter(this, predicate));
}

/**
* Returns an Observable that forwards all distinct items emitted from the source Observable.
*
* @return an Observable of distinct items
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229764%28v=vs.103%29.aspx">MSDN: Observable.distinct</a>
*/
public Observable<T> distinct() {
return create(OperationDistinct.distinct(this));
}

/**
* Returns an Observable that forwards all items emitted from the source Observable that are distinct according to
* a key selector function.
*
* @param keySelector
* a function that projects an emitted item to a key value which is used for deciding whether an item is
* distinct from another one or not
* @return an Observable of distinct items
* @see <a href="http://msdn.microsoft.com/en-us/library/hh244310%28v=vs.103%29.aspx">MSDN: Observable.distinct</a>
*/
public <U> Observable<T> distinct(Func1<? super T, ? extends U> keySelector) {
return create(OperationDistinct.distinct(this, keySelector));
}
Expand Down

0 comments on commit 243e624

Please sign in to comment.