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

21
LINES

< > BotCompany Repo | #1010114 // web_findBackwardRelated

JavaX fragment (include)

1  
static WebNode web_findBackwardRelated(WebNode node, S relationLabel) {
2  
  ret web_findBackwardRelated(node, node.web.parseLabel(relationLabel));
3  
}
4  
5  
static WebNode web_findBackwardRelated(WebNode node, Lisp relationLabel) {
6  
  Web web = node.web;
7  
  for (Pair<WebNode> p : keys(web.relations))
8  
    if (p.b == node) {
9  
      WebNode rel = web.relations.get(p);
10  
      if (rel != null && rel.hasLabel(relationLabel)) ret p.a;
11  
    }
12  
  null;
13  
}
14  
15  
static WebNode web_findBackwardRelated(WebNode node) {
16  
  Web web = node.web;
17  
  for (Pair<WebNode> p : keys(web.relations))
18  
    if (p.b == node)
19  
      ret p.a;
20  
  null;
21  
}

Author comment

Began life as a copy of #1009833

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: #1010114
Snippet name: web_findBackwardRelated
Eternal ID of this version: #1010114/4
Text MD5: b7a85db520bc1d24b71b6cda6da0fc81
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-02 16:22:30
Source code size: 624 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 408 / 462
Version history: 3 change(s)
Referenced in: [show references]