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

9
LINES

< > BotCompany Repo | #1004896 // orderMapByDescendingValue

JavaX fragment (include)

1  
// return a fancy litorderedmap
2  
static <A, B> Map<A, B> orderMapByDescendingValue(final Map<A, B> map) {
3  
  L<A> l = new ArrayList(map.keySet());
4  
  sort(l, mapComparatorDesc(map));
5  
  Map<A, B> map2 = litorderedmap();
6  
  for (A a : l)
7  
    map2.put(a, map.get(a));
8  
  ret map2;
9  
}

Author comment

Began life as a copy of #1002585

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004896
Snippet name: orderMapByDescendingValue
Eternal ID of this version: #1004896/3
Text MD5: 3cf78fb07dfbfadf1dc6ad792d2d4757
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:59:38
Source code size: 282 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 560 / 566
Version history: 2 change(s)
Referenced in: [show references]