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

8
LINES

< > BotCompany Repo | #1007624 // orderMapByValue

JavaX fragment (include)

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

Author comment

Began life as a copy of #1004896

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007624
Snippet name: orderMapByValue
Eternal ID of this version: #1007624/3
Text MD5: d9edd1a37be8c78e2cf77e88fd20ef82
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-17 15:57:28
Source code size: 255 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 425 / 441
Version history: 2 change(s)
Referenced in: [show references]