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

15
LINES

< > BotCompany Repo | #1024406 // mapToValues_ciMap - iterate on list, keep object as key, function result as value

JavaX fragment (include)

1  
static Map mapToValues_ciMap(Iterable<S> l, O f) {
2  
  ret mapToValues_ciMap(f, l);
3  
}
4  
5  
static Map mapLike mapToValues_ciMap(O f, Iterable<S> l) {
6  
  Map map = ciMap();
7  
  if (l != null) for (S o : l)
8  
    map.put(o, callF(f, o));
9  
  ret map;
10  
}
11  
12  
13  
static <B> Map<S, B> mapToValues_ciMap(Iterable<S> l, IF1<S, B> f) {
14  
  ret mapToValues_ciMap(f, l);
15  
}

Author comment

Began life as a copy of #1021879

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: #1024406
Snippet name: mapToValues_ciMap - iterate on list, keep object as key, function result as value
Eternal ID of this version: #1024406/4
Text MD5: a7a8a85577b8f496d50eb12e5955dd51
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-01 00:40:27
Source code size: 355 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 209 / 254
Version history: 3 change(s)
Referenced in: [show references]