it.unimi.di.mg4j.index
Class QuasiSuccinctIndexReader.RankedIndexIterator

java.lang.Object
  extended by it.unimi.di.mg4j.index.AbstractIndexIterator
      extended by it.unimi.di.mg4j.index.QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
          extended by it.unimi.di.mg4j.index.QuasiSuccinctIndexReader.RankedIndexIterator
All Implemented Interfaces:
IndexIterator, DocumentIterator
Enclosing class:
QuasiSuccinctIndexReader

protected static final class QuasiSuccinctIndexReader.RankedIndexIterator
extends QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator


Field Summary
protected  QuasiSuccinctIndexReader.RankedPointerReader pointers
          The pointer reader for the current term.
 
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
 
Fields inherited from class it.unimi.di.mg4j.index.AbstractIndexIterator
id, term, weight
 
Fields inherited from interface it.unimi.di.mg4j.index.IndexIterator
END_OF_POSITIONS
 
Fields inherited from interface it.unimi.di.mg4j.search.DocumentIterator
END_OF_LIST
 
Constructor Summary
QuasiSuccinctIndexReader.RankedIndexIterator(QuasiSuccinctIndexReader indexReader)
           
 
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
 
Methods inherited from class it.unimi.di.mg4j.index.AbstractIndexIterator
accept, acceptOnTruePaths, id, id, term, term, weight, weight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pointers

protected QuasiSuccinctIndexReader.RankedPointerReader pointers
The pointer reader for the current term.

Constructor Detail

QuasiSuccinctIndexReader.RankedIndexIterator

public QuasiSuccinctIndexReader.RankedIndexIterator(QuasiSuccinctIndexReader indexReader)
Method Detail

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 kDocumentIterator.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