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 newIteratorIterablefor the givenIterator -
Method Summary
Modifier and TypeMethodDescriptionstatic <Type> IteratorIterable<Type>For a givenIteratorthis method returns anIterablewhoseIterable.iterator()will return exactly that iterator.iterator()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IteratorIterable
Creates a newIteratorIterablefor the givenIterator- Parameters:
iterator- the iterator to iterate. Must not be null.
-
-
Method Details
-
iterator
-
create
For a givenIteratorthis method returns anIterablewhoseIterable.iterator()will return exactly that iterator.
-