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 (56L/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 20 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, 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: 36805ef954b0e3f123acf3ccd04ab65e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-10 16:13:40
Source code size: 250 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 815 / 3214
Version history: 2 change(s)
Referenced in: #1017247 - CloseableIterableIterator
#1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)