public class BasicIterablePosting extends BasicPostingImpl implements IterablePosting
Modifier and Type | Field and Description |
---|---|
protected BitIn |
bitFileReader |
protected DocumentIndex |
doi |
protected int |
numEntries |
dl, id, tf
END_OF_LIST, EOL
Constructor and Description |
---|
BasicIterablePosting()
Empty constructor used ONLY for reflection
|
BasicIterablePosting(BitIn _bitFileReader,
int _numEntries,
DocumentIndex _doi)
Constructor
|
Modifier and Type | Method and Description |
---|---|
WritablePosting |
asWritablePosting()
Copies this posting to one free of an iterator.
|
void |
close() |
boolean |
endOfPostings()
Status method to see if this posting list iterator has been finished
|
int |
getDocumentLength()
Returns 0
|
int |
next()
Move this iterator to the next posting.
|
int |
next(int target)
Move this iterator to the posting with specified id, or next posting after that.
|
String |
toString()
Makes a human readable form of this posting
|
getFrequency, getId, readFields, setDocumentLength, setId, setTf, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFrequency, getId, setId
protected int numEntries
protected BitIn bitFileReader
protected DocumentIndex doi
public BasicIterablePosting()
public BasicIterablePosting(BitIn _bitFileReader, int _numEntries, DocumentIndex _doi) throws IOException
_bitFileReader
- The bit file where we read the postings from_numEntries
- Total number of postings to read before returning EOL_doi
- The document index to get the doc length of the current docidIOException
public boolean endOfPostings()
IterablePosting
endOfPostings
in interface IterablePosting
public int getDocumentLength()
BasicPostingImpl
getDocumentLength
in interface Posting
getDocumentLength
in class BasicPostingImpl
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public WritablePosting asWritablePosting()
BasicPostingImpl
asWritablePosting
in interface Posting
asWritablePosting
in class BasicPostingImpl
public String toString()
BasicPostingImpl
toString
in class BasicPostingImpl
public int next() throws IOException
IterablePosting
next
in interface IterablePosting
IOException
public int next(int target) throws IOException
IterablePosting
next
in interface IterablePosting
target
- id of the posting to find in this posting list.IOException
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow