1 | static <A, B> Comparator<A> mapComparator(final Map<A, B> map) { |
2 | ret new Comparator<A>() { |
3 | public int compare(A a, A b) { |
4 | ret cmp(map.get(a), map.get(b)); |
5 | } |
6 | }; |
7 | } |
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, whxojlpjdney
No comments. add comment
Snippet ID: | #1007530 |
Snippet name: | mapComparator - compare by value in map |
Eternal ID of this version: | #1007530/5 |
Text MD5: | 4df33075a9ddd42d2b8ab1182b8eda8a |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-26 11:58:56 |
Source code size: | 185 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 619 / 659 |
Version history: | 4 change(s) |
Referenced in: | [show references] |