1 | static <A> A bestByScoreFunction(Iterable<A> l, IF1<A, Number> f) { |
2 | new Best<A> best; |
3 | for (A a : unnull(l)) { |
4 | Number score = callF(f, a); |
5 | if (score != null) |
6 | best.put(a, toDouble(score)); |
7 | } |
8 | ret best!; |
9 | } |
Began life as a copy of #1023137
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023138 |
Snippet name: | bestByScoreFunction |
Eternal ID of this version: | #1023138/1 |
Text MD5: | 11fb868a275522955af84723b60882b4 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-05-15 14:31:42 |
Source code size: | 231 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 268 / 302 |
Referenced in: | [show references] |