Closed GoogleCodeExporter closed 9 years ago
What about:
for (TimeUnit unit : EnumSet.allOf(TimeUnit.class)) { ... }
Original comment by k...@kloover.com
on 3 May 2013 at 8:06
Or even:
for (TimeUnit unit : TimeUnit.values()) { ... }
Original comment by k...@kloover.com
on 3 May 2013 at 8:08
Enumeration<Type> foo = ...
Iterators.forEnumeration(foo)
and then use Iterables or FluentIterable to do your stuff.
Original comment by amer...@gmail.com
on 3 May 2013 at 8:23
to comment #1 and #2:
java.util.Enumeration != java.lang.Enum
Original comment by SeanPFl...@googlemail.com
on 3 May 2013 at 9:50
The issue with this is that Enumeration is single-use, like Iterator. So while
you can create an Iterator from an Enumeration, you can't create a proper
Iterable from one any more than you can from an Iterator.
Original comment by cgdec...@gmail.com
on 3 May 2013 at 12:12
Indeed, the Iterator as Iterable view is listed in the idea graveyard, and this
would seem to fall into the same category.
Original comment by wasserman.louis
on 3 May 2013 at 3:53
Original comment by cgdec...@gmail.com
on 3 May 2013 at 5:52
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
adigu...@gmail.com
on 3 May 2013 at 7:48