Package it.unimi.dsi.webgraph
Class MergedIntIterator
java.lang.Object
it.unimi.dsi.webgraph.MergedIntIterator
- All Implemented Interfaces:
LazyIntIterator
An iterator returning the union of the integers returned by two
IntIterators.
The two iterators must return integers in an increasing fashion; the resulting
MergedIntIterator will do the same. Duplicates will be eliminated.-
Constructor Summary
ConstructorsConstructorDescriptionMergedIntIterator(LazyIntIterator it0, LazyIntIterator it1) Creates a new merged iterator by merging two given iterators; the resulting iterator will not emit more thannintegers. -
Method Summary
-
Constructor Details
-
MergedIntIterator
Creates a new merged iterator by merging two given iterators; the resulting iterator will not emit more thannintegers.- Parameters:
it0- the first (monotonically nondecreasing) component iterator.it1- the second (monotonically nondecreasing) component iterator.
-
-
Method Details
-
nextInt
public int nextInt()Description copied from interface:LazyIntIteratorThe next integer returned by this iterator, or the special marker if this iterator is exhausted.- Specified by:
nextIntin interfaceLazyIntIterator- Returns:
- next integer returned by this iterator, or the special marker if this iterator is exhausted.
-
skip
public int skip(int s) Description copied from interface:LazyIntIteratorSkips a given number of elements.- Specified by:
skipin interfaceLazyIntIterator- Parameters:
s- the number of elements to skip.- Returns:
- the number of elements actually skipped (which might
be less than
nif this iterator is exhausted).
-