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

7
LINES

< > BotCompany Repo | #1024990 // iotaKeys - list to map, keys = 1, 2, 3, ...

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

Libraryless. Click here for Pure Java version (2124L/13K).

static <A> Map<Int, A> iotaKeys(Cl<A> l) {
  new LinkedHashMap<Int, A> map;
  int i = 0;
  fOr (A a : l)
    map.put(++i, a);
  ret map;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024990
Snippet name: iotaKeys - list to map, keys = 1, 2, 3, ...
Eternal ID of this version: #1024990/1
Text MD5: f90b47433c96001d269c582a9ad2f5e9
Transpilation MD5: fdd8d080c382f11abd4eca58c85b3644
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-31 23:27:49
Source code size: 144 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 141 / 205
Referenced in: [show references]