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

7
LINES

< > BotCompany Repo | #1028768 // listToMapWithKeyMaker

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2460L/16K).

static <A, B> LinkedHashMap<A, B> listToMapWithKeyMaker(L<B> l, IF1<Int, A> f) {
  new LinkedHashMap<A, B> map;
  int n = l(l);
  for i to n:
    map.put(f.get(i), l.get(i));
  ret map;
}

Author comment

Began life as a copy of #1014587

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028768
Snippet name: listToMapWithKeyMaker
Eternal ID of this version: #1028768/1
Text MD5: aed59ecadb79b3a8e4fb9c179c56b4b8
Transpilation MD5: 4a779b2cddc6a1528ec2238e0225a550
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-08 00:14:32
Source code size: 193 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 181 / 266
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)