Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created June 18, 2015 18:51
Show Gist options
  • Save jsanda/8435a91e02fcd1d68c83 to your computer and use it in GitHub Desktop.
Save jsanda/8435a91e02fcd1d68c83 to your computer and use it in GitHub Desktop.
Func2<Observable<DataPoint<Double>>, Func1<Observable<Double>, Observable<Double>>, Observable<Double>> apply =
(dataPoints, func) -> func.call(dataPoints.map(DataPoint::getValue));
Observable<DataPoint<Double>> dataPoints = null; // fetch the data...
Observable<Double> avgerage = apply.call(dataPoints, MathObservable::averageDouble);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment