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

21
LINES

< > BotCompany Repo | #1010114 // web_findBackwardRelated

JavaX fragment (include)

static WebNode web_findBackwardRelated(WebNode node, S relationLabel) {
  ret web_findBackwardRelated(node, node.web.parseLabel(relationLabel));
}

static WebNode web_findBackwardRelated(WebNode node, Lisp relationLabel) {
  Web web = node.web;
  for (Pair<WebNode> p : keys(web.relations))
    if (p.b == node) {
      WebNode rel = web.relations.get(p);
      if (rel != null && rel.hasLabel(relationLabel)) ret p.a;
    }
  null;
}

static WebNode web_findBackwardRelated(WebNode node) {
  Web web = node.web;
  for (Pair<WebNode> p : keys(web.relations))
    if (p.b == node)
      ret p.a;
  null;
}

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: 409 / 463
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010600 - web_travelBackwards - synonym of findBackwardRelated