Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1023138 // bestByScoreFunction

JavaX fragment (include)

static <A> A bestByScoreFunction(Iterable<A> l, IF1<A, Number> f) {
  new Best<A> best;
  for (A a : unnull(l)) {
    Number score = callF(f, a);
    if (score != null)
      best.put(a, toDouble(score));
  }
  ret best!;
}

Author comment

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: 182 / 213
Referenced in: [show references]