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

9
LINES

< > BotCompany Repo | #1004754 // reverseMapAsMultiMap

JavaX fragment (include)

static <A, B> MultiMap<B, A> reverseMapAsMultiMap(Map<A, B> map) {
  ret reverseMapAsMultiMap(map, new MultiMap);
}

static <A, B> MultiMap<B, A> reverseMapAsMultiMap(Map<A, B> map, MultiMap<B, A> mm) {
  for (A key : keys(map))
    mm.put(map.get(key), key);
  ret mm;
}

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: #1004754
Snippet name: reverseMapAsMultiMap
Eternal ID of this version: #1004754/3
Text MD5: 60b05dee43b05415c8928b3ba9595e68
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-23 20:33:28
Source code size: 279 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 574 / 588
Version history: 2 change(s)
Referenced in: [show references]