static <A, B extends Number> A keyWithBiggestValue(Map<A, B> map) { A best = null; Number bestScore = null; for (A key : keys(map)) { Number score = map.get(key); if (best == null || cmp(score, bestScore) > 0) { best = key; bestScore = score; } } ret best; }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1002040 |
Snippet name: | keyWithBiggestValue |
Eternal ID of this version: | #1002040/1 |
Text MD5: | 51cc1f6da6ff41db2d8e057996181699 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-12-15 00:16:12 |
Source code size: | 303 bytes / 12 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 682 / 1665 |
Referenced in: | [show references] |