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

15
LINES

< > BotCompany Repo | #1010448 // web_moveRelations

JavaX fragment (include)

static void web_moveRelations(WebNode src, WebNode dest) {
  if (src == dest) ret;
  Web web = src.web;
  assertSame(web, dest.web);
  
  for (Pair<WebNode> p : cloneList(web_relations(web))) {
    if (p.a == src && p.b != dest) {
      web.getRelation(dest, p.b).addLabels(web.getRelation(p).labels);
      web_deleteRelation(p.a, p.b);
    } else if (p.b == src && p.a != dest) {
      web.getRelation(p.a, dest).addLabels(web.getRelation(p).labels);
      web_deleteRelation(p.a, p.b);
    }
  }
}

Author comment

Began life as a copy of #1009970

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010448
Snippet name: web_moveRelations
Eternal ID of this version: #1010448/4
Text MD5: 295dc042dfa950d8d14a425f2e2ad905
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-27 11:19:14
Source code size: 514 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 472 / 479
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)