it.unimi.di.mg4j.index
Class QuasiSuccinctIndexReader.RankedIndexIterator
java.lang.Object
it.unimi.di.mg4j.index.AbstractIndexIterator
it.unimi.di.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
it.unimi.di.mg4j.index.QuasiSuccinctIndexReader.RankedIndexIterator
- All Implemented Interfaces:
- IndexIterator, DocumentIterator
- Enclosing class:
- QuasiSuccinctIndexReader
protected static final class QuasiSuccinctIndexReader.RankedIndexIterator
- extends QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
Fields inherited from class it.unimi.di.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator |
count, counts, countsList, currentDocument, currentTerm, frequency, hasCounts, hasPositions, index, indexReader, nextPosition, numberOfDocuments, occurrency, pointersList, pointersUpperBits, positions, positionsList |
Method Summary |
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. |
int |
nextDocument()
Returns the next document provided by this document iterator, or DocumentIterator.END_OF_LIST if no more documents are available. |
protected boolean |
position(int term)
|
int |
skipTo(int n)
Skips all documents smaller than n . |
Methods inherited from class it.unimi.di.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator |
dispose, document, frequency, index, indices, intervalIterator, intervalIterator, intervalIterators, nextPosition, payload, ranked, termNumber, toString |
pointers
protected QuasiSuccinctIndexReader.RankedPointerReader pointers
- The pointer reader for the current term.
QuasiSuccinctIndexReader.RankedIndexIterator
public QuasiSuccinctIndexReader.RankedIndexIterator(QuasiSuccinctIndexReader indexReader)
position
protected boolean position(int term)
nextDocument
public int nextDocument()
throws IOException
- Description copied from interface:
DocumentIterator
- Returns the next document provided by this document iterator, or
DocumentIterator.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 int skipTo(int n)
throws IOException
- Description copied from interface:
DocumentIterator
- Skips all documents smaller than
n
.
Define the current document k
associated with this document iterator
as follows:
If k
is larger than or equal to n
, then
this method does nothing and returns k
. Otherwise, a
call to this method is equivalent to
while( ( 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 to DocumentIterator.nextDocument()
that returned k
.
In particular, the first document larger than or equal to n
(when returned
by this method) will not be returned by the next call to
DocumentIterator.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
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