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

11
LINES

< > BotCompany Repo | #1018161 // listToMapWithValueFunction

JavaX fragment (include)

// f: A -> B
static <A, B> LinkedHashMap<A, B> listToMapWithValueFunction(Iterable<A> l, O f) {
  new LinkedHashMap<A, B> map;
  for (A a : unnull(l))
    map.put(a, (B) callF(f, a));
  ret map;
}

static <A, B> LinkedHashMap<A, B> listToMapWithValueFunction(O f, Iterable<A> l) {
  ret listToMapWithValueFunction(l, f);
}

Author comment

Began life as a copy of #1014587

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018161
Snippet name: listToMapWithValueFunction
Eternal ID of this version: #1018161/3
Text MD5: 1d37bf005eb965e92d51393258fb35e9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-05 13:50:09
Source code size: 332 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 246 / 270
Version history: 2 change(s)
Referenced in: [show references]