Package it.unimi.di.big.mg4j.index
Class IndexIntervalIterator
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.IndexIntervalIterator
-
- All Implemented Interfaces:
IntervalIterator
public final class IndexIntervalIterator extends Object implements IntervalIterator
An interval iterator returning the positions of the current document as singleton intervals.
-
-
Constructor Summary
Constructors Constructor Description IndexIntervalIterator(IndexIterator indexIterator)
-
Method Summary
Modifier and Type Method Description intextent()Returns an approximation of a lower bound for the length of an interval returned by this iterator.voidintervalTerms(LongSet terms)Provides the set of terms that span the current interval.IntervalnextInterval()Returns the next interval provided by this interval iterator, ornullif no more intervals are available.IndexIntervalIteratorreset()A no-op.
-
-
-
Constructor Detail
-
IndexIntervalIterator
public IndexIntervalIterator(IndexIterator indexIterator)
-
-
Method Detail
-
reset
public IndexIntervalIterator reset() throws IOException
A no-op.- Specified by:
resetin interfaceIntervalIterator- Returns:
- this iterator.
- Throws:
IOException
-
intervalTerms
public void intervalTerms(LongSet terms)
Description copied from interface:IntervalIteratorProvides the set of terms that span the current interval.For each interval returned by MG4J, there is a set of terms that caused the interval to be returned. The terms appear inside the interval, and certainly at its extremes.
Note that the results of this method must be taken with a grain of salt: there might be different sets of terms causing the current interval, and only one will be returned.
- Specified by:
intervalTermsin interfaceIntervalIterator- Parameters:
terms- a set of integers that will be filled with the terms spanning the current interval.
-
nextInterval
public Interval nextInterval() throws IOException
Description copied from interface:IntervalIteratorReturns the next interval provided by this interval iterator, ornullif no more intervals are available.- Specified by:
nextIntervalin interfaceIntervalIterator- Returns:
- the next interval, or
nullif no more intervals are available. - Throws:
IOException
-
extent
public int extent()
Description copied from interface:IntervalIteratorReturns an approximation of a lower bound for the length of an interval returned by this iterator.- Specified by:
extentin interfaceIntervalIterator- Returns:
- an approximation of a lower bound for the length of an interval.
-
-