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

8
LINES

< > BotCompany Repo | #1024463 // mapPut2_createLinkedHashMap

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

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

static <A, B> LinkedHashMap<A, B> mapPut2_createLinkedHashMap(LinkedHashMap<A, B> map, A key, B value) {
  if (key != null)
    if (value != null) {
      if (map == null) map = new LinkedHashMap;
      map.put(key, value);
    } else if (map != null) map.remove(key);
  ret map;
}

Author comment

Began life as a copy of #1008151

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: #1024463
Snippet name: mapPut2_createLinkedHashMap
Eternal ID of this version: #1024463/3
Text MD5: d47fbf5ea4e8edb015e6c89818325419
Transpilation MD5: c93de21ecbc62af073afddc25517c85b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-13 18:48:34
Source code size: 288 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 265 / 342
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1024464 - syncMapPut2_createLinkedHashMap
#1024478 - mapPutOrCreate - make HashMap if null