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


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

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

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

static Map 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 <A, B, C> Map<A, C> lambdaMapLike mapValues(IF1<B, C> f, Map<A, B> map) {
  ret mapValues((O) f, map);

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

download  show line numbers  debug dex   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1004652
Snippet name: mapValues - apply function to a map's values
Eternal ID of this version: #1004652/7
Text MD5: 7e7c7c839b87e6928a2b3706d46ff719
Transpilation MD5: 3356c4b177b1eda5d98e1e5eae878441
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-26 12:24:28
Source code size: 447 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 389 / 409
Version history: 6 change(s)
Referenced in: [show references]

Formerly at &