Slide 11
Slide 11 text
コード量が減る
Observable.from(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
.filter(new Func1() {
@Override
public Boolean call(Integer i) {
return (i % 2) == 0;
}
})
.map(new Func1() {
@Override
public Integer call(Integer i) {
return i * 10;
}
})
.subscribe(new Observer() {
@Override
public void onNext(Integer integer) {
Log.d("TAG", integer.toString());
}
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
});
20, 40, 60, 80, 100