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

14
LINES

< > BotCompany Repo | #1017072 // generalDefinitions_addMultiple

JavaX fragment (include)

static Pair<Bool, S> generalDefinitions_addMultiple(Collection<Pair<S>> list) {
  MultiMap<S, Pair<S>> mm = mechMultiMapPairsCI(generalDefinitions_listName());
  
  new LinkedHashMap toAdd;
  for (Pair<S> p : list)
    if (nempty(p.a) && nempty(p.b) && !mapPairB(f dropGlobalID, mm.get(p.a)).contains(p))
      toAdd.put(p.a, appendGlobalID(p.b));

  if (empty(toAdd))
    ret pair(false, "Nothing to do");
    
  addToMechMap(generalDefinitions_listName(), toAdd);
  ret pair(true, print(n2(toAdd, "definition") + " added"));
}

Author comment

Began life as a copy of #1017007

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: #1017072
Snippet name: generalDefinitions_addMultiple
Eternal ID of this version: #1017072/5
Text MD5: ad8de3793d29fc0c44604072f5e33555
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-11 17:44:42
Source code size: 541 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 349 / 372
Version history: 4 change(s)
Referenced in: [show references]