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

14
LINES

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

JavaX fragment (include)

static Map mapToValues_treeMap(Iterable l, O f) {
  ret mapToValues_treeMap(f, l);
}

static Map mapLike mapToValues_treeMap(O f, Iterable l) {
  new TreeMap map;
  if (l != null) for (O o : l)
    map.put(o, callF(f, o));
  ret map;
}

static <A, B> Map<A, B> mapToValues_treeMap(Iterable<A> l, IF1<A, B> f) {
  ret mapToValues_treeMap(f, l);
}

Author comment

Began life as a copy of #1024406

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: #1024573
Snippet name: mapToValues_treeMap - iterate on list, keep object as key, function result as value
Eternal ID of this version: #1024573/5
Text MD5: e4a4bb8f2fff85f409d5f101a56b8a21
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-18 20:41:07
Source code size: 358 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 248 / 266
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1028708 - mapToValues_linkedHashMap