1 | static <A> IterableIterator<A> iterableIterator(final Iterator<A> it) { |
2 | ret it == null ? null : new IterableIterator<A> { |
3 | public bool hasNext() { ret it.hasNext(); } |
4 | public A next() { ret it.next(); } |
5 | public void remove() { it.remove(); } |
6 | }; |
7 | } |
8 | |
9 | static <A> IterableIterator<A> iterableIterator(final Collection<A> it) { |
10 | ret iterableIterator(iterator(it)); |
11 | } |
Began life as a copy of #1011464
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: | #1014178 |
Snippet name: | iterableIterator - convert Iterator or Collection to IterableIterator |
Eternal ID of this version: | #1014178/4 |
Text MD5: | 42a7711d9a8797d70f05fb6827c372aa |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-25 21:00:06 |
Source code size: | 384 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 361 / 400 |
Version history: | 3 change(s) |
Referenced in: | [show references] |