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

11
LINES

< > BotCompany Repo | #1018161 // listToMapWithValueFunction

JavaX fragment (include)

1  
// f: A -> B
2  
static <A, B> LinkedHashMap<A, B> listToMapWithValueFunction(Iterable<A> l, O f) {
3  
  new LinkedHashMap<A, B> map;
4  
  for (A a : unnull(l))
5  
    map.put(a, (B) callF(f, a));
6  
  ret map;
7  
}
8  
9  
static <A, B> LinkedHashMap<A, B> listToMapWithValueFunction(O f, Iterable<A> l) {
10  
  ret listToMapWithValueFunction(l, f);
11  
}

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: 304 / 330
Version history: 2 change(s)
Referenced in: [show references]