Package it.unimi.di.big.mg4j.index
Class BitStreamHPIndexReader
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.AbstractIndexReader
-
- it.unimi.di.big.mg4j.index.BitStreamHPIndexReader
-
- All Implemented Interfaces:
IndexReader
,SafelyCloseable
,Closeable
,AutoCloseable
public class BitStreamHPIndexReader extends AbstractIndexReader
A bitstream-based index reader for high-performance indices.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BitStreamHPIndexReader.BitStreamHPIndexReaderIndexIterator
-
Field Summary
Fields Modifier and Type Field Description protected BitStreamHPIndex
index
The reference index.protected BitStreamHPIndexReader.BitStreamHPIndexReaderIndexIterator
indexIterator
TheIndexIterator
view of this reader (returned bydocuments(CharSequence)
).-
Fields inherited from class it.unimi.di.big.mg4j.index.AbstractIndexReader
closed
-
-
Constructor Summary
Constructors Constructor Description BitStreamHPIndexReader(BitStreamHPIndex index, InputBitStream ibs, InputBitStream positions)
Creates a new skip index reader, with the specified underlyingIndex
and input bit stream.
-
Method Summary
Modifier and Type Method Description void
close()
IndexIterator
documents(long term)
Returns a document iterator over the documents containing a term.IndexIterator
documents(CharSequence term)
Returns an index iterator over the documents containing a term; the term is given explicitly.IndexIterator
nextIterator()
Throws anUnsupportedOperationException
.String
toString()
-
Methods inherited from class it.unimi.di.big.mg4j.index.AbstractIndexReader
finalize
-
-
-
-
Field Detail
-
index
protected final BitStreamHPIndex index
The reference index.
-
indexIterator
protected final BitStreamHPIndexReader.BitStreamHPIndexReaderIndexIterator indexIterator
TheIndexIterator
view of this reader (returned bydocuments(CharSequence)
).
-
-
Constructor Detail
-
BitStreamHPIndexReader
public BitStreamHPIndexReader(BitStreamHPIndex index, InputBitStream ibs, InputBitStream positions)
Creates a new skip index reader, with the specified underlyingIndex
and input bit stream.- Parameters:
index
- the index.ibs
- the underlying bit stream.
-
-
Method Detail
-
documents
public IndexIterator documents(long term) 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 toterm()
.Note that it is always possible to call this method with argument 0, even if the underlying index does not provide random access.
- Parameters:
term
- 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 toterm()
.- 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 anUnsupportedOperationException
.- Specified by:
nextIterator
in interfaceIndexReader
- Overrides:
nextIterator
in classAbstractIndexReader
- Returns:
- the index iterator of the next term, or
null
if there are no more terms after the current one. - Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractIndexReader
- Throws:
IOException
-
-