Package it.unimi.di.big.mg4j.index
Class QuasiSuccinctIndexReader.RankedIndexIterator
- 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.RankedIndexIterator
-
- All Implemented Interfaces:
IndexIterator,DocumentIterator
- Enclosing class:
- QuasiSuccinctIndexReader
protected static final class QuasiSuccinctIndexReader.RankedIndexIterator extends QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected QuasiSuccinctIndexReader.RankedPointerReaderpointersThe 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 RankedIndexIterator(QuasiSuccinctIndexReader indexReader)
-
Method Summary
Modifier and Type Method Description intcount()Returns the count, that is, the number of occurrences of the term in the current document.booleanmayHaveNext()Returns whether there may be a next document, possibly with false positives.longnextDocument()Returns the next document provided by this document iterator, orDocumentIterator.END_OF_LISTif no more documents are available.protected booleanposition(long termNumber, long frequency, long occurrency)longskipTo(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.RankedPointerReader pointers
The pointer reader for the current term.
-
-
Constructor Detail
-
RankedIndexIterator
public RankedIndexIterator(QuasiSuccinctIndexReader indexReader)
-
-
Method Detail
-
position
protected boolean position(long termNumber, long frequency, long occurrency)
-
nextDocument
public long nextDocument() throws IOExceptionDescription copied from interface:DocumentIteratorReturns the next document provided by this document iterator, orDocumentIterator.END_OF_LISTif no more documents are available.- Returns:
- the next document, or
DocumentIterator.END_OF_LISTif no more documents are available. - Throws:
IOException
-
skipTo
public long skipTo(long n) throws IOExceptionDescription copied from interface:DocumentIteratorSkips all documents smaller thann.Define the current document
kassociated 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
kis 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_LISTis 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
nif available,DocumentIterator.END_OF_LISTotherwise. - Throws:
IOException
- -1, if
-
mayHaveNext
public boolean mayHaveNext()
Description copied from interface:DocumentIteratorReturns 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 IOExceptionDescription copied from interface:IndexIteratorReturns 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
-
-