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

18
LINES

< > BotCompany Repo | #1028172 // mapValuesToLinkedHashMap - apply function to a map's values

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

Transpiled version (2503L) is out of date.

static LinkedHashMap lambdaMapLike mapValuesToLinkedHashMap(O func, Map map) {
  new LinkedHashMap m;
  for (O key : keys(map))
    m.put(key, callF(func, map.get(key)));
  ret m;
}

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

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

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

Author comment

Began life as a copy of #1004652

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1028172
Snippet name: mapValuesToLinkedHashMap - apply function to a map's values
Eternal ID of this version: #1028172/2
Text MD5: e67591be124a2c2b366365180ee8a8aa
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:26:23
Source code size: 583 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 205 / 315
Version history: 1 change(s)
Referenced in: [show references]