public class BitPostingIndexInputStream extends Object implements PostingIndexInputStream, Skipable
Modifier and Type | Field and Description |
---|---|
protected int |
currentEntryCount |
protected byte |
currentFile |
protected BitIndexPointer |
currentPointer |
protected DocumentIndex |
doi |
protected int |
entriesSkipped |
protected int |
fieldCount |
protected BitIn |
file
The gamma compressed file containing the terms.
|
protected byte |
fileCount |
protected IndexOnDisk |
index |
protected static org.slf4j.Logger |
logger |
protected Iterator<? extends BitIndexPointer> |
pointerList
the lexicon input stream providing the offsets
|
protected Constructor<? extends IterablePosting> |
postingConstructor |
protected Class<? extends IterablePosting> |
postingIteratorClass |
protected String |
structureName |
Constructor and Description |
---|
BitPostingIndexInputStream(IndexOnDisk _index,
String _structureName,
Iterator<? extends BitIndexPointer> _pointerList,
Class<? extends IterablePosting> _postingIteratorClass)
Constructs an instance of BitPostingIndexInputStream.
|
Modifier and Type | Method and Description |
---|---|
protected BitIndexPointer |
_next() |
void |
close() |
Pointer |
getCurrentPointer()
Returns the pointer associated with the current postings being accessed
|
protected DocumentIndex |
getDocumentIndex(BitIndexPointer pointer) |
int |
getEntriesSkipped()
Returns the number of entries that were skipped during
a call to the next().
|
static String |
getFilename(IndexOnDisk _index,
String structureName,
byte fileCount,
byte fileId)
Returns filename
|
static String |
getFilename(String path,
String prefix,
String structureName,
byte fileCount,
byte fileId)
Return filename
|
IterablePosting |
getNextPostings()
Return the next IterablePosting object, or null if none defined.
|
int |
getNumberOfCurrentPostings()
Returns the number of postings in the current IterablePosting object
|
BitFilePosition |
getPos()
Get the file position
|
boolean |
hasNext() |
protected IterablePosting |
loadPostingIterator(BitIndexPointer pointer) |
IterablePosting |
next() |
void |
print()
Print a list of the postings to standard out
|
void |
remove()
Not supported
|
void |
skip(int numEntries)
Skip forward the specified number of entries.
|
protected static final org.slf4j.Logger logger
protected final Iterator<? extends BitIndexPointer> pointerList
protected BitIn file
protected Class<? extends IterablePosting> postingIteratorClass
protected Constructor<? extends IterablePosting> postingConstructor
protected int currentEntryCount
protected BitIndexPointer currentPointer
protected int fieldCount
protected int entriesSkipped
protected byte fileCount
protected byte currentFile
protected IndexOnDisk index
protected DocumentIndex doi
protected String structureName
public BitPostingIndexInputStream(IndexOnDisk _index, String _structureName, Iterator<? extends BitIndexPointer> _pointerList, Class<? extends IterablePosting> _postingIteratorClass) throws IOException
_index
- _structureName
- _pointerList
- _postingIteratorClass
- IOException
public static String getFilename(String path, String prefix, String structureName, byte fileCount, byte fileId)
path
- prefix
- structureName
- fileCount
- fileId
- public static String getFilename(IndexOnDisk _index, String structureName, byte fileCount, byte fileId)
_index
- structureName
- fileCount
- fileId
- public BitFilePosition getPos()
public void skip(int numEntries) throws IOException
skip
in interface Skipable
numEntries
- number of entries to skipIOException
- if an IO problem occurs.public int getNumberOfCurrentPostings()
getNumberOfCurrentPostings
in interface PostingIndexInputStream
public IterablePosting getNextPostings() throws IOException
getNextPostings
in interface PostingIndexInputStream
IOException
- if an I/O problem occurs.public boolean hasNext()
hasNext
in interface Iterator<IterablePosting>
protected BitIndexPointer _next()
public IterablePosting next()
next
in interface Iterator<IterablePosting>
public int getEntriesSkipped()
getEntriesSkipped
in interface PostingIndexInputStream
protected IterablePosting loadPostingIterator(BitIndexPointer pointer) throws IOException
IOException
protected DocumentIndex getDocumentIndex(BitIndexPointer pointer)
public void print()
print
in interface PostingIndexInputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void remove()
remove
in interface Iterator<IterablePosting>
public Pointer getCurrentPointer()
getCurrentPointer
in interface PostingIndexInputStream
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow