Class OrDocumentIterator.OrIndexIntervalIterator
- java.lang.Object
-
- it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator
-
- it.unimi.di.big.mg4j.search.OrDocumentIterator.OrIndexIntervalIterator
-
- All Implemented Interfaces:
IntervalIterator
- Enclosing class:
- OrDocumentIterator
protected class OrDocumentIterator.OrIndexIntervalIterator extends AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator implements IntervalIterator
-
-
Field Summary
-
Fields inherited from class it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator
curr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOrIndexIntervalIterator(Index index, int n)
-
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.IntervalIteratorreset()Resets the internal state of this iterator for a new document.-
Methods inherited from class it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator
toString
-
-
-
-
Constructor Detail
-
OrIndexIntervalIterator
protected OrIndexIntervalIterator(Index index, int n)
-
-
Method Detail
-
reset
public IntervalIterator reset() throws IOException
Description copied from interface:IntervalIteratorResets the internal state of this iterator for a new document.To reduce object creation, interval iterators are usually created in a lazy fashion by document iterator when they are needed. However, this implies that every time the document iterator is moved, some internal state of the interval iterator must be reset (e.g., because on the new document some of the component interval iterators are now
IntervalIterators.TRUE). The semantics of this method is largely implementation dependent, with the important exception that the return value must beIntervalIterators.FALSEif the first call toIntervalIterator.nextInterval()will returnnull.- Specified by:
resetin interfaceIntervalIterator- Returns:
IntervalIterators.FALSEif this interval iterator will returnnullat the first call toIntervalIterator.nextInterval(); this interval iterator, otherwise.- 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.
-
-