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

16
LINES

< > BotCompany Repo | #1030668 // ListWalker

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2712L/16K).

static persistable class ListWalker<A> implements Iterator<A> {
  L<A> list;
  int index;
  
  *(L<A> *list) {}
  
  public A next() {
    if (index < l(list))
      ret list.get(index++);
    null;
  }
  
  public bool hasNext() {
    ret index < l(list);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030668
Snippet name: ListWalker
Eternal ID of this version: #1030668/3
Text MD5: 8b174b440958cee1dbf04ab14a1916e5
Transpilation MD5: a123fe99acf8da6edbd3e87efd8dd917
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-02-25 20:58:27
Source code size: 277 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 237 / 439
Version history: 2 change(s)
Referenced in: [show references]