- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 178字
- 2021-07-23 16:36:22
Map operator
Unquestioningly, the most used operator in RxJava is map, which has the following signature:
<R> Observable<R> map(Func1<T, R> func)
The preceding method declaration means that the func function can transform the T object type to the R object type, and applying map transforms Observable<T> into Observable<R>. However, a signature does not always describe the operator's behavior well, especially if the operator is doing a complex transformation. For these purposes, Marble diagrams were invented. Marble diagrams visually present stream transformations. They are so effective for describing the operator's behavior that almost all RxJava operators contain the image with a marble diagram in Javadoc. The map operator is represented by the following diagram:

From looking at the preceding diagram, it should be clear that the map makes a one-to-one transformation. Furthermore, the output stream has the same number of elements as the input stream.
- 黑客攻防實戰(zhàn)技術(shù)完全手冊:掃描、嗅探、入侵與防御
- 網(wǎng)絡(luò)協(xié)議工程
- EDA技術(shù)與VHDL編程
- Building Django 2.0 Web Applications
- 計算機網(wǎng)絡(luò)與數(shù)據(jù)通信
- Go Web Scraping Quick Start Guide
- Drush User’s Guide
- 互聯(lián)網(wǎng)安全的40個智慧洞見:2015年中國互聯(lián)網(wǎng)安全大會文集
- NB-IoT物聯(lián)網(wǎng)技術(shù)解析與案例詳解
- 新手易學(xué):新手學(xué)淘寶開店
- TD-LTE無線網(wǎng)絡(luò)規(guī)劃與設(shè)計
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 互聯(lián)網(wǎng)安全的40個智慧洞見(2016)
- 5G非正交多址接入技術(shù):理論、算法與實現(xiàn)
- OSPF協(xié)議原理與功能拓展