Package com.saperion.util
Class IteratorIterable<Type>
java.lang.Object
com.saperion.util.IteratorIterable<Type>
- All Implemented Interfaces:
Iterable<Type>
For a given
Iterator
an IteratorIterable
is a corresponding Iterable
- and thus usable in the extended for-syntax.-
Constructor Summary
ConstructorsConstructorDescriptionIteratorIterable
(Iterator<Type> iterator) Creates a newIteratorIterable
for the givenIterator
-
Method Summary
Modifier and TypeMethodDescriptionstatic <Type> IteratorIterable<Type>
For a givenIterator
this method returns anIterable
whoseIterable.iterator()
will return exactly that iterator.iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IteratorIterable
Creates a newIteratorIterable
for the givenIterator
- Parameters:
iterator
- the iterator to iterate. Must not be null.
-
-
Method Details
-
iterator
-
create
For a givenIterator
this method returns anIterable
whoseIterable.iterator()
will return exactly that iterator.
-