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

17
LINES

< > BotCompany Repo | #1009833 - web_findForwardRelated

JavaX fragment (include)

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

static WebNode web_findForwardRelated(WebNode node, Lisp relationLabel) {
  ret web_findForwardRelated(node.web, node, relationLabel);
}

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

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1009833
Snippet name: web_findForwardRelated
Eternal ID of this version: #1009833/4
Text MD5: d5674344573a1c4090b495e40fc3ab3b
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-03 23:46:03
Source code size: 565 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 290 / 298
Version history: 3 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1009833 & http://1009833.tinybrain.de