RxJava Mapping functions

RxJava has several mapping functions. These functions transforms the emitted items to another form or value. The mapping functions are: map flatMap concatMap flatMapIterable switchMap   map function maps the items to another value of the same or different type @Test public void testobservableMap() { List<Integer> list = new ArrayList<>(); IntStream.range(0, 1000).forEach(list::add); Observable<Integer> observableFromCollection = … More RxJava Mapping functions

RxJava Operations on Observables

Filtering and other operations on Observables If only a subset of elements in a stream is needed, a filter can be used to eliminate the items not needed and let the observable emit only desired elements. @Test public void testCreateObservableFromCollectionWithFilter() { List<Integer> list = new ArrayList<>(); IntStream.range(0, 1000).forEach(list::add); Observable<Integer> observableFromCollection = Observable.from(list).filter(e -> e%2==0); observableFromCollection.subscribe(new … More RxJava Operations on Observables

Creating Observables and Subscribers in RxJava

RxJava is a very useful library for asynchronous and event-based programming, also called reactive programming. There are two main actors in RxJava: Observables — An object that emits a stream of data or events Observers/Subscribers — An object that acts upon the emitted data.   An observer is an object which know how to act upon 3 sort of … More Creating Observables and Subscribers in RxJava

Precision and Recall calculation for Search Engines

Search engines retrieves a number of documents as a result for a query. However, the relevance of the result can also be checked by consulting the users. For the details, see Cranfield Evaluation Methodology. Depending on the user group, different users might find different result sets more relevant. Depending on the context, sometimes, a user … More Precision and Recall calculation for Search Engines