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

14
LINES

< > BotCompany Repo | #1004652 - mapValues - apply function to a map's values

JavaX fragment (include)

static Map mapLike mapValues(O func, Map map) {
  Map m = similarEmptyMap(map);
  for (O key : keys(map))
    m.put(key, callF(func, map.get(key)));
  ret m;
}

static <A, B, C> Map<A, C> mapValues(Map<A, B> map, IF1<B, C> f) {
  ret mapValues(f, map);
}

static Map mapValues(Map map, O func) {
  ret mapValues(func, map);
}

download  show line numbers  debug dex   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1004652
Snippet name: mapValues - apply function to a map's values
Eternal ID of this version: #1004652/4
Text MD5: e0e3e17c60b688b785d0ef162f6724ee
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-15 22:18:21
Source code size: 338 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 349 / 339
Version history: 3 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1004652 & http://1004652.tinybrain.de