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

11
LINES

< > BotCompany Repo | #1014345 // reverseLookupAll - look up all keys for a value

JavaX fragment (include)

1  
static <A, B> L<A> reverseLookupAll(B value, Map<A, B> map) {
2  
  ret reverseLookupAll(map, value);
3  
}
4  
5  
static <A, B> L<A> reverseLookupAll(Map<A, B> map, B value) {
6  
  new L<A> l;
7  
  if (map != null && value != null) for (A key : map.keySet())
8  
    if (eq(map.get(key), value))
9  
      l.add(key);
10  
  ret l;
11  
}

Author comment

Began life as a copy of #1002303

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014345
Snippet name: reverseLookupAll - look up all keys for a value
Eternal ID of this version: #1014345/1
Text MD5: 62f897a5115d8b13cd2313bd978150ff
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-20 13:00:25
Source code size: 311 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 319 / 355
Referenced in: [show references]