public class BasicIntegerCodingIterablePosting extends Object implements IterablePosting
Modifier and Type | Field and Description |
---|---|
protected int |
blkCnt |
protected int |
chunkSize
Number of postings in a chunk
|
protected int |
currentPosting |
protected boolean |
decompressed |
protected DocumentIndex |
documentIndex |
protected int |
id |
protected int[] |
ids |
protected IntegerCodec |
idsCodec |
protected ByteIn |
input |
protected static org.slf4j.Logger |
logger
The logger used
|
protected int |
numberOfEntries |
protected int |
tf |
protected int[] |
tfs |
protected IntegerCodec |
tfsCodec |
END_OF_LIST, EOL
Constructor and Description |
---|
BasicIntegerCodingIterablePosting(ByteIn input,
int numberOfEntries,
DocumentIndex documentIndex,
int chunkSize,
IntegerCodec idsCodec,
IntegerCodec tfsCodec) |
Modifier and Type | Method and Description |
---|---|
WritablePosting |
asWritablePosting()
Copies this posting to one free of an iterator.
|
void |
close() |
protected void |
decompress()
This load the a chunk (tfs) and decompress it
|
boolean |
endOfPostings()
Status method to see if this posting list iterator has been finished
|
protected void |
get(int pos)
Read the posting components from the chunk
|
long |
getCurrentAddress() |
int |
getDocumentLength()
Return the length of the document for this posting.
|
int |
getFrequency()
Return the frequency of the term in the current document
|
int |
getId()
Return the id of the current posting.
|
protected void |
load()
This load a chunk (just the document ids!) and decompress it
|
int |
next()
Move this iterator to the next posting.
|
int |
next(int targetId)
Move this iterator to the posting with specified id, or next posting after that.
|
void |
setId(int id)
It may be of benefit to update the frequency of the id in some applications.
|
protected void |
skip()
If tfs, fields frequencies and blocks are not required, skip that
part of the chunk
|
String |
toString()
Makes a human readable form of this posting
|
protected static final org.slf4j.Logger logger
protected DocumentIndex documentIndex
protected int chunkSize
protected int numberOfEntries
protected int currentPosting
protected int id
protected int tf
protected final int[] ids
protected final int[] tfs
protected final ByteIn input
protected final IntegerCodec idsCodec
protected final IntegerCodec tfsCodec
protected int blkCnt
protected boolean decompressed
public BasicIntegerCodingIterablePosting(ByteIn input, int numberOfEntries, DocumentIndex documentIndex, int chunkSize, IntegerCodec idsCodec, IntegerCodec tfsCodec) throws IOException
input
- the input channelnumberOfEntries
- the number of postingsdocumentIndex
- the document indexchunkSize
- the size of the chunkidsCodec
- the IntegerCodec to use to decode docIdstfsCodec
- the IntegerCodec to use to decode term frequenciesIOException
public int getId()
Posting
public int getFrequency()
Posting
getFrequency
in interface Posting
public int getDocumentLength()
Posting
getDocumentLength
in interface Posting
public void setId(int id)
Posting
public WritablePosting asWritablePosting()
Posting
asWritablePosting
in interface Posting
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected final void load() throws IOException
IOException
protected void decompress() throws IOException
IOException
protected void skip() throws IOException
IOException
protected void get(int pos) throws IOException
pos
- the posting to load (as index in the internal arrays)IOException
public int next() throws IOException
IterablePosting
next
in interface IterablePosting
IOException
public int next(int targetId) throws IOException
IterablePosting
next
in interface IterablePosting
targetId
- id of the posting to find in this posting list.IOException
public boolean endOfPostings()
IterablePosting
endOfPostings
in interface IterablePosting
public String toString()
public long getCurrentAddress()
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow