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

7
LINES

< > BotCompany Repo | #1035106 // iterator_gen

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

Libraryless. Click here for Pure Java version (7542L/42K).

static Iterator iterator_gen(O o) {
  if (o == null) ret emptyItIt();
  if (o cast Iterator) ret o;
  if (o cast Iterable) ret o.iterator();
  if (o cast O[]) ret arrayIterator(o);
  fail("Not iterable: " + className(o));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035106
Snippet name: iterator_gen
Eternal ID of this version: #1035106/1
Text MD5: 24ec40e25cc9a4515b8be108a7c1f7f1
Transpilation MD5: 29277346aa67300e10f3f690a9d7d6d5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-30 02:23:12
Source code size: 229 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 164 / 199
Referenced in: [show references]