it.unimi.di.mg4j.index
Class QuasiSuccinctIndexReader

java.lang.Object
  extended by it.unimi.di.mg4j.index.AbstractIndexReader
      extended by it.unimi.di.mg4j.index.QuasiSuccinctIndexReader
All Implemented Interfaces:
IndexReader, SafelyCloseable, Closeable

public class QuasiSuccinctIndexReader
extends AbstractIndexReader
implements IndexReader

An index reader for quasi-succinct indices.


Nested Class Summary
protected static class QuasiSuccinctIndexReader.AbstractQuasiSuccinctIndexIterator
           
protected static class QuasiSuccinctIndexReader.CountReader
           
protected static class QuasiSuccinctIndexReader.EliasFanoIndexIterator
           
protected static class QuasiSuccinctIndexReader.EliasFanoPointerReader
           
protected static class QuasiSuccinctIndexReader.LongWordBitReader
           
protected static class QuasiSuccinctIndexReader.PointerReader
           
protected static class QuasiSuccinctIndexReader.PositionReader
           
protected static class QuasiSuccinctIndexReader.RankedIndexIterator
           
protected static class QuasiSuccinctIndexReader.RankedPointerReader
           
 
Field Summary
protected  LongBigList countsList
          A reference to the data for counts, or null of index has counts.
protected  QuasiSuccinctIndexReader.EliasFanoIndexIterator eliasFanoIndexIterator
          An index iterator that can read Elias-Fano pointer lists.
protected  QuasiSuccinctIndex index
          The index, cached.
protected  LongBigList pointersList
          A reference to the data for pointers.
protected  QuasiSuccinctIndexReader.LongWordBitReader pointersUpperBits
          A longword bit reader used for the upper bits of pointers and to check whether a posting list is ranked or not.
protected  LongBigList positionsList
          A reference to the data for positions, or null of index has positions.
protected  QuasiSuccinctIndexReader.RankedIndexIterator rankedIndexIterator
          An index iterator that can read ranked pointer lists.
 
Fields inherited from class it.unimi.di.mg4j.index.AbstractIndexReader
closed
 
Constructor Summary
QuasiSuccinctIndexReader(QuasiSuccinctIndex index)
           
 
Method Summary
 IndexIterator documents(CharSequence term)
          Returns an index iterator over the documents containing a term; the term is given explicitly.
 IndexIterator documents(int termNumber)
          Returns a document iterator over the documents containing a term.
 IndexIterator nextIterator()
          Throws an UnsupportedOperationException.
 
Methods inherited from class it.unimi.di.mg4j.index.AbstractIndexReader
close, finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.Closeable
close
 

Field Detail

eliasFanoIndexIterator

protected final QuasiSuccinctIndexReader.EliasFanoIndexIterator eliasFanoIndexIterator
An index iterator that can read Elias-Fano pointer lists.


rankedIndexIterator

protected final QuasiSuccinctIndexReader.RankedIndexIterator rankedIndexIterator
An index iterator that can read ranked pointer lists.


index

protected final QuasiSuccinctIndex index
The index, cached.


pointersList

protected final LongBigList pointersList
A reference to the data for pointers.


countsList

protected final LongBigList countsList
A reference to the data for counts, or null of index has counts.


positionsList

protected final LongBigList positionsList
A reference to the data for positions, or null of index has positions.


pointersUpperBits

protected final QuasiSuccinctIndexReader.LongWordBitReader pointersUpperBits
A longword bit reader used for the upper bits of pointers and to check whether a posting list is ranked or not.

Constructor Detail

QuasiSuccinctIndexReader

public QuasiSuccinctIndexReader(QuasiSuccinctIndex index)
Method Detail

documents

public IndexIterator documents(int termNumber)
                        throws IOException
Description copied from interface: IndexReader
Returns a document iterator over the documents containing a term.

Note that the index iterator returned by this method will return null on a call to term().

Note that it is always possible to call this method with argument 0, even if the underlying index does not provide random access.

Specified by:
documents in interface IndexReader
Parameters:
termNumber - the number of a term.
Throws:
IOException

documents

public IndexIterator documents(CharSequence term)
                        throws IOException
Description copied from interface: IndexReader
Returns an index iterator over the documents containing a term; the term is given explicitly.

Unless the term processor of the associated index is null, words coming from a query will have to be processed before being used with this method.

Note that the index iterator returned by this method will return term on a call to term().

Specified by:
documents in interface IndexReader
Parameters:
term - a term (the term will be downcased if the index is case insensitive).
Throws:
IOException

nextIterator

public IndexIterator nextIterator()
                           throws IOException
Description copied from class: AbstractIndexReader
Throws an UnsupportedOperationException.

Specified by:
nextIterator in interface IndexReader
Overrides:
nextIterator in class AbstractIndexReader
Returns:
the index iterator of the next term, or null if there are no more terms after the current one.
Throws:
IOException