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

12
LINES

< > BotCompany Repo | #1009970 // web_copyRelations

JavaX fragment (include)

1  
static void web_copyRelations(WebNode src, WebNode dest) {
2  
  if (src == dest) ret;
3  
  Web web = src.web;
4  
  assertSame(web, dest.web);
5  
  
6  
  for (Pair<WebNode> p : cloneList(keys(web.relations))) {
7  
    if (p.a == src)
8  
      web.getRelation(dest, p.b).addLabels(web.getRelation(p).labels);
9  
    if (p.b == src)
10  
      web.getRelation(p.a, dest).addLabels(web.getRelation(p).labels);
11  
  }
12  
}

Author comment

Began life as a copy of #1009837

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: #1009970
Snippet name: web_copyRelations
Eternal ID of this version: #1009970/4
Text MD5: 0901a57b81c8e28cf92f4902317bd020
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-27 23:25:07
Source code size: 393 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 575 / 596
Version history: 3 change(s)
Referenced in: [show references]