Guest User

Untitled

a guest
Nov 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. package cn.chenhaonee.wallet.rx;
  2.  
  3. import io.reactivex.Observable;
  4.  
  5. public class ScanExample {
  6.  
  7. public void example() {
  8. Observable.just(1, 2, 3)
  9. .scan((i1, i2) -> i1 + i2)
  10. .subscribe(integer -> System.out.println("accept: scan " + integer));
  11. }
  12.  
  13. public static void main(String[] args) {
  14. new ScanExample().example();
  15. }
  16.  
  17. /**
  18. * Output:
  19. * accept: scan 1
  20. * accept: scan 3
  21. * accept: scan 6
  22. */
  23. }
Add Comment
Please, Sign In to add comment