Package it.unimi.dsi.big.webgraph
Class MergedLongIterator
- java.lang.Object
-
- it.unimi.dsi.big.webgraph.MergedLongIterator
-
- All Implemented Interfaces:
LazyLongIterator
public class MergedLongIterator extends java.lang.Object implements LazyLongIterator
An iterator returning the union of the integers returned by twoIntIterators. The two iterators must return integers in an increasing fashion; the resultingMergedLongIteratorwill do the same. Duplicates will be eliminated.
-
-
Constructor Summary
Constructors Constructor Description MergedLongIterator(LazyLongIterator it0, LazyLongIterator it1)Creates a new merged iterator by merging two given iterators.MergedLongIterator(LazyLongIterator it0, LazyLongIterator it1, long n)Creates a new merged iterator by merging two given iterators; the resulting iterator will not emit more thannintegers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longnextLong()The next long returned by this iterator, or the special marker if this iterator is exhausted.longskip(long s)Skips a given number of elements.
-
-
-
Constructor Detail
-
MergedLongIterator
public MergedLongIterator(LazyLongIterator it0, LazyLongIterator it1)
Creates a new merged iterator by merging two given iterators.- Parameters:
it0- the first (monotonically nondecreasing) component iterator.it1- the second (monotonically nondecreasing) component iterator.
-
MergedLongIterator
public MergedLongIterator(LazyLongIterator it0, LazyLongIterator it1, long n)
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.n- the maximum number of integers this merged iterator will return.
-
-
Method Detail
-
nextLong
public long nextLong()
Description copied from interface:LazyLongIteratorThe next long returned by this iterator, or the special marker if this iterator is exhausted.- Specified by:
nextLongin interfaceLazyLongIterator- Returns:
- next long returned by this iterator, or the special marker if this iterator is exhausted.
-
skip
public long skip(long s)
Description copied from interface:LazyLongIteratorSkips a given number of elements.- Specified by:
skipin interfaceLazyLongIterator- 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).
-
-