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

14
LINES

< > BotCompany Repo | #1012352 // ai_triplesToWebNodes_lazyList

JavaX fragment (include)

1  
static L<WebNode> ai_triplesToWebNodes_lazyList(final Symbol searchTerm, final L<TripleWeb> l) {
2  
  ret new LazyList<WebNode>() {
3  
    final int n = l(l);
4  
    public int size() { ret n; }
5  
    public WebNode get(int i) {
6  
      TripleWeb w = syncGet(l, i);
7  
      if (w == null) null;
8  
      int runLength = 0;
9  
      while (i-runLength > 0 && l.get(i-runLength-1) == w)
10  
        ++runLength;
11  
      ret ai_tripleToWebNode(l.get(i), searchTerm, runLength);
12  
    }
13  
  };
14  
}

Author comment

Began life as a copy of #1012335

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: #1012352
Snippet name: ai_triplesToWebNodes_lazyList
Eternal ID of this version: #1012352/8
Text MD5: a7537997060165a19b6e796b63556f71
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-10 07:24:12
Source code size: 473 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 377 / 414
Version history: 7 change(s)
Referenced in: [show references]