Returns an iterator over the merged contents of all given iterators, traversing every element of the input iterators. Equivalent entries will not be de-duplicated. Callers must ensure that the source iterators are in non-descending order as this method does not sort its input. <
(Iterable<? extends Iterator<? extends T>> iterators, Comparator<? super T> comparator)
| 1284 | */ |
| 1285 | |
| 1286 | @Beta |
| 1287 | public static <T> UnmodifiableIterator<T> mergeSorted(Iterable<? extends Iterator<? extends T>> iterators, Comparator<? super T> comparator) { |
| 1288 | checkNotNull(iterators, "iterators"); |
| 1289 | checkNotNull(comparator, "comparator"); |
| 1290 | return new MergingIterator<T>(iterators, comparator); |
| 1291 | } |
| 1292 | |
| 1293 | /** |
| 1294 | * An iterator that performs a lazy N-way merge, calculating the next value |
no test coverage detected