Package it.unimi.di.big.mg4j.index
Class QuasiSuccinctIndexReader.EliasFanoIndexIterator
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.AbstractIndexIterator
-
- it.unimi.di.big.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
-
- it.unimi.di.big.mg4j.index.QuasiSuccinctIndexReader.EliasFanoIndexIterator
-
- All Implemented Interfaces:
IndexIterator
,DocumentIterator
- Enclosing class:
- QuasiSuccinctIndexReader
protected static final class QuasiSuccinctIndexReader.EliasFanoIndexIterator extends QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected QuasiSuccinctIndexReader.EliasFanoPointerReader
pointers
The pointer reader for the current term.-
Fields inherited from class it.unimi.di.big.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
count, counts, countsList, currentDocument, currentTerm, frequency, hasCounts, hasPositions, index, indexReader, nextPosition, numberOfDocuments, occurrency, pointersList, positions, positionsList
-
Fields inherited from class it.unimi.di.big.mg4j.index.AbstractIndexIterator
id, term, weight
-
Fields inherited from interface it.unimi.di.big.mg4j.search.DocumentIterator
END_OF_LIST
-
Fields inherited from interface it.unimi.di.big.mg4j.index.IndexIterator
END_OF_POSITIONS
-
-
Constructor Summary
Constructors Constructor Description EliasFanoIndexIterator(QuasiSuccinctIndexReader indexReader)
-
Method Summary
Modifier and Type Method Description int
count()
Returns the count, that is, the number of occurrences of the term in the current document.boolean
mayHaveNext()
Returns whether there may be a next document, possibly with false positives.long
nextDocument()
Returns the next document provided by this document iterator, orDocumentIterator.END_OF_LIST
if no more documents are available.protected boolean
position(long termNumber, long frequency, long occurrency)
long
skipTo(long n)
Skips all documents smaller thann
.-
Methods inherited from class it.unimi.di.big.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
dispose, document, frequency, index, indices, intervalIterator, intervalIterator, intervalIterators, nextPosition, payload, termNumber, toString
-
Methods inherited from class it.unimi.di.big.mg4j.index.AbstractIndexIterator
accept, acceptOnTruePaths, id, id, term, term, weight, weight
-
-
-
-
Field Detail
-
pointers
protected QuasiSuccinctIndexReader.EliasFanoPointerReader pointers
The pointer reader for the current term.
-
-
Constructor Detail
-
EliasFanoIndexIterator
public EliasFanoIndexIterator(QuasiSuccinctIndexReader indexReader)
-
-
Method Detail
-
position
protected boolean position(long termNumber, long frequency, long occurrency)
-
nextDocument
public long nextDocument() throws IOException
Description copied from interface:DocumentIterator
Returns the next document provided by this document iterator, orDocumentIterator.END_OF_LIST
if no more documents are available.- Returns:
- the next document, or
DocumentIterator.END_OF_LIST
if no more documents are available. - Throws:
IOException
-
skipTo
public long skipTo(long n) throws IOException
Description copied from interface:DocumentIterator
Skips all documents smaller thann
.Define the current document
k
associated with this document iterator as follows:- -1, if
DocumentIterator.nextDocument()
and this method have never been called; DocumentIterator.END_OF_LIST
, if a call to this method or toDocumentIterator.nextDocument()
returnedDocumentIterator.END_OF_LIST
;- the last value returned by a call to
DocumentIterator.nextDocument()
or this method, otherwise.
If
k
is larger than or equal ton
, then this method does nothing and returnsk
. Otherwise, a call to this method is equivalent towhile( ( k = nextDocument() ) < n ); return k;
Thus, when a result
k
≠DocumentIterator.END_OF_LIST
is returned, the state of this iterator will be exactly the same as after a call toDocumentIterator.nextDocument()
that returnedk
. In particular, the first document larger than or equal ton
(when returned by this method) will not be returned by the next call toDocumentIterator.nextDocument()
.- Parameters:
n
- a document pointer.- Returns:
- a document pointer larger than or equal to
n
if available,DocumentIterator.END_OF_LIST
otherwise. - Throws:
IOException
- -1, if
-
mayHaveNext
public boolean mayHaveNext()
Description copied from interface:DocumentIterator
Returns whether there may be a next document, possibly with false positives.- Returns:
- true there may be a next document; false if certainly there is no next document.
-
count
public int count() throws IOException
Description copied from interface:IndexIterator
Returns the count, that is, the number of occurrences of the term in the current document.- Returns:
- the count (number of occurrences) of the term in the current document.
- Throws:
IOException
-
-