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

5
LINES

< > BotCompany Repo | #1010215 // getIterator - convert object to iterator [fails if not convertible]

JavaX fragment (include)

static Iterator getIterator(O o) {
  if (o instanceof Iterator) ret (Iterator) o;
  if (o instanceof Iterable) ret ((Iterable) o).iterator();
  fail("Can't convert to iterator: " + className(o));
}

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: #1010215
Snippet name: getIterator - convert object to iterator [fails if not convertible]
Eternal ID of this version: #1010215/3
Text MD5: 1753da66de13c5f377a0ff3584e65dcb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-06 20:34:51
Source code size: 201 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 520 / 510
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)