K
- public class FileRunIterator<K extends PostingInRun> extends RunIterator
Modifier and Type | Field and Description |
---|---|
protected int |
currentPosting
Current Posting List number
|
protected int |
maxSize
max number of pointers any term in the run
|
protected BitIn |
mbis
Input stream for reading the run.
|
protected int |
size
Number of postings in this run
|
protected DataInputStream |
stringDIS
Input stream for reading the terms.
|
flushNo, numberOfFields, posting, postingClass
Constructor and Description |
---|
FileRunIterator(String filename,
String termsFile,
int runNo,
Class<? extends PostingInRun> _postingInRunClass,
int fieldCount)
Load a new run from files.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the run files being processed
|
boolean |
hasNext()
Are there more posting to process in this run?
|
PostingInRun |
next()
Move to the next posting in this run
|
String |
readString()
Reads the String identifying a term from the underlying stream.
|
int |
readTermFrequency()
Reads the term frequency for the current posting, and aligns the stream.
|
createPosting, current, getRunNo, remove
protected BitIn mbis
protected DataInputStream stringDIS
protected int size
protected int currentPosting
protected int maxSize
public FileRunIterator(String filename, String termsFile, int runNo, Class<? extends PostingInRun> _postingInRunClass, int fieldCount) throws Exception
filename
- the filename of the file containing the posting liststermsFile
- the filename of the file containing the term namesrunNo
- the number of this run_postingInRunClass
- the class that all postings in this class haveException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class RunIterator
IOException
public boolean hasNext()
hasNext
in interface Iterator<PostingInRun>
hasNext
in class RunIterator
public PostingInRun next()
next
in interface Iterator<PostingInRun>
next
in class RunIterator
public int readTermFrequency() throws IOException
IOException
- if an I/O error occurs.public String readString() throws IOException
IOException
- if an I/O error occurs.Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow