java.lang.Object
org.evrete.util.CombinationIterator<T>
- Type Parameters:
T- The type of the elements generated by the source iterators.
- All Implemented Interfaces:
Iterator<T[]>
An iterator that generates all possible combinations of elements from source objects.
-
Constructor Summary
ConstructorsConstructorDescriptionClass constructorCombinationIterator(S[] sources, T[] sharedResultArray, Function<S, Iterator<T>> iteratorFunction) Class constructor with shared result array that will be updated on eachnext()operationCombinationIterator(T[] sharedResultArray, IntFunction<Iterator<T>> iteratorFunction) Class constructor with shared result array that will be updated on eachnext()operation -
Method Summary
Modifier and TypeMethodDescriptionprotected TadvanceIterator(int index) booleanhasNext()T[]next()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
CombinationIterator
Class constructor- Parameters:
type- type of the resulting arraysources- an array of sourcesiteratorFunction- a mapping function to create iterators from sources
-
CombinationIterator
public CombinationIterator(S[] sources, T[] sharedResultArray, Function<S, Iterator<T>> iteratorFunction) Class constructor with shared result array that will be updated on eachnext()operation- Parameters:
sources- an array of sourcessharedResultArray- a shared result arrayiteratorFunction- a mapping function to create iterators from sources
-
CombinationIterator
Class constructor with shared result array that will be updated on eachnext()operation- Parameters:
sharedResultArray- a shared result arrayiteratorFunction- a mapping function to create iterators by array index
-
-
Method Details