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)

static <A, B> L<A> reverseLookupAll(B value, Map<A, B> map) {
  ret reverseLookupAll(map, value);
}

static <A, B> L<A> reverseLookupAll(Map<A, B> map, B value) {
  new L<A> l;
  if (map != null && value != null) for (A key : map.keySet())
    if (eq(map.get(key), value))
      l.add(key);
  ret l;
}

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: 363 / 401
Referenced in: [show references]