public class EnumerationIterable<T> extends Object implements Iterable<T>
Enumeration
that allows it to be used in for-each
loops. This is useful when working with objects that return an iterator rather
than a collection in order to protect access to their state.
Note: this class does not allow re-iteration of the enumeration. Calling iterator()
multiple times will return iterators that refer to the same source
enumeration.
Constructor and Description |
---|
EnumerationIterable(Enumeration<T> enumeration) |
Modifier and Type | Method and Description |
---|---|
Iterator<T> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator