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

10
LINES

< > BotCompany Repo | #1004285 - IterableIterator (ItIt for short) - an Iterator that is castable to Iterable for use in for loops

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

Libraryless. Click here for Pure Java version (54L/1K).

// you still need to implement hasNext() and next()
static abstract class IterableIterator<A> implements Iterator<A>, Iterable<A> {
  public Iterator<A> iterator() {
    this;
  }
  
  public void remove() {
    unsupportedOperation();
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, podlckwnjdmb, ppjhyzlbdabe, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1004285
Snippet name: IterableIterator (ItIt for short) - an Iterator that is castable to Iterable for use in for loops
Eternal ID of this version: #1004285/3
Text MD5: 1a7d8650a61d9e7adfb34f3480d0cab2
Transpilation MD5: 0d1d013a1d5e929443557246bd657682
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-22 20:20:23
Source code size: 250 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 569 / 2855
Version history: 2 change(s)
Referenced in: [show references]