Package fr.gouv.vitam.batch.report.model
Class MergeSortedIterator<A,E>
- java.lang.Object
-
- fr.gouv.vitam.batch.report.model.MergeSortedIterator<A,E>
-
- Type Parameters:
A
-E
-
- All Implemented Interfaces:
java.util.Iterator<E>
public class MergeSortedIterator<A,E> extends java.lang.Object implements java.util.Iterator<E>
This Iterator take two sorted iterators and merge them. Loop over iterators and use comparator in order to take items that are equals. The merge is done using the function mergeFunction
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
E
next()
-
-
-
Constructor Detail
-
MergeSortedIterator
public MergeSortedIterator(java.util.Iterator<A> one, java.util.Iterator<A> two, java.util.Comparator<A> comparator, java.util.function.BiFunction<A,A,E> mergeFunction)
- Parameters:
one
- The first sorted iteratortwo
- The second sorted iteratorcomparator
- The comparator that compare items of iteratorsmergeFunction
- The function that merge elements of iterators
-
-