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

6
LINES

< > BotCompany Repo | #1027786 // mapGetOrCreateHashMap

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

Libraryless. Click here for Pure Java version (31L/1K).

static <A, B, C> Map<B, C> mapGetOrCreateHashMap(Map<A, Map<B, C>> map, A key) {
  Map<B, C> b = map.get(key);
  if (b == null)
    map.put(key, b = new HashMap);
  ret b;
}

Author comment

Began life as a copy of #1024987

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: #1027786
Snippet name: mapGetOrCreateHashMap
Eternal ID of this version: #1027786/10
Text MD5: be95eb706d086aaaadeaf2729a7b669f
Transpilation MD5: 8fee0bd6f5315c0bc7742b98a9e324f4
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-11 19:44:11
Source code size: 178 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 210 / 341
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)