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

6
LINES

< > BotCompany Repo | #1017107 // twoElementListsToHashMap - make HashMap from collection of two-element lists

JavaX fragment (include)

static <A, B> HashMap<A, B> twoElementListsToHashMap(Collection<L<A>> l) {
  new HashMap<A, B> map;
  if (l != null) for (L<A> p : l)
    if (l(p) == 2) map.put(first(p), second(p));
  ret map;
}

Author comment

Began life as a copy of #1011045

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017107
Snippet name: twoElementListsToHashMap - make HashMap from collection of two-element lists
Eternal ID of this version: #1017107/4
Text MD5: b04e87ba435c8b411086e8c9978e2aae
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-12 14:11:01
Source code size: 200 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 275 / 320
Version history: 3 change(s)
Referenced in: [show references]