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

15
LINES

< > BotCompany Repo | #1012620 // strictPutIC - mapPutStrictly with ignore-case - return true if value can be put strictly (not overwriting anything)

JavaX fragment (include)

static <A> bool strictPutIC(Map<A, S> map, A key, S value) {
  if (!(map != null && key != null && value != null)) true;
  S old = map.get(key);
  if (old == null) { map.put(key, value); true; }
  ret eqic(old, value);
}

ifclass Symbol
static bool strictPutIC(SymbolSymbol map, Symbol key, Symbol value) {
  if (!(map != null && key != null && value != null)) true;
  Symbol old = map.get(key);
  if (old == null) { map.put(key, value); true; }
  ret eqic(old, value);
}
endif

Author comment

Began life as a copy of #1012146

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012620
Snippet name: strictPutIC - mapPutStrictly with ignore-case - return true if value can be put strictly (not overwriting anything)
Eternal ID of this version: #1012620/6
Text MD5: 61ec5cd04e1fd4118e401d5924d3d67f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-15 15:58:14
Source code size: 491 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 425 / 491
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1013194 - strictSetIC - returns true if value can be put strictly (not overwriting anything)
#1021396 - strictPutICIfKeyNotEqualToValue