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

7
LINES

< > BotCompany Repo | #1005171 // reverseMultiMapAsMap

JavaX fragment (include)

1  
static <A, B> Map<B, A> reverseMultiMapAsMap(MultiMap<A, B> mm) {
2  
  new HashMap<B, A> map;
3  
  for (A a : mm.keys())
4  
    for (B b : mm.get(a))
5  
      map.put(b, a);
6  
  ret map;
7  
}

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: #1005171
Snippet name: reverseMultiMapAsMap
Eternal ID of this version: #1005171/1
Text MD5: 351385cc8686c78dbd769f1c856c454d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-18 19:22:50
Source code size: 180 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 480 / 470
Referenced in: [show references]