org.terrier.structures.indexing.singlepass
Class PostingInRun

java.lang.Object
  extended by org.terrier.structures.indexing.singlepass.PostingInRun
Direct Known Subclasses:
SimplePostingInRun

public abstract class PostingInRun
extends java.lang.Object

Base class for PostingInRun classes


Field Summary
protected  BitIn postingSource
          source for postings to be read from
protected  java.lang.String term
          Current term
protected  int termDf
          Document frequency
protected  int termTF
          tf for the current posting
 
Constructor Summary
PostingInRun()
          Constructs an instance of the PostingInRun.
 
Method Summary
 void addToLexiconEntry(LexiconEntry le)
          Add statistics for this posting onto the given LexiconEntry
 int append(BitOut bos, int last)
          Writes the document data of this posting to a BitOut It encodes the data with the right compression methods.
abstract  int append(BitOut bos, int last, int runShift)
          Writes the document data of this posting to a BitOut It encodes the data with the right compression methods.
 int getDf()
           
 LexiconEntry getLexiconEntry()
          Return the LexiconEntry for this Posting
abstract  IterablePosting getPostingIterator(int runShift)
          Returns an IterablePosting object for the postings in this run
 java.lang.String getTerm()
           
 int getTF()
           
 void setDf(int df)
          Setter for the document frequency.
 void setPostingSource(BitIn source)
          Set where the postings should be read from
 void setTerm(java.lang.String _term)
          Setter for the term.
 void setTF(int tf)
          Setter for the term frequency.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

postingSource

protected BitIn postingSource
source for postings to be read from


termTF

protected int termTF
tf for the current posting


term

protected java.lang.String term
Current term


termDf

protected int termDf
Document frequency

Constructor Detail

PostingInRun

public PostingInRun()
Constructs an instance of the PostingInRun.

Method Detail

getLexiconEntry

public LexiconEntry getLexiconEntry()
Return the LexiconEntry for this Posting


addToLexiconEntry

public void addToLexiconEntry(LexiconEntry le)
Add statistics for this posting onto the given LexiconEntry


getDf

public int getDf()
Returns:
the document frequency for the term.

setDf

public void setDf(int df)
Setter for the document frequency.

Parameters:
df - int with the new document frequency.

getTerm

public java.lang.String getTerm()
Returns:
The term String in this posting list.

setTerm

public void setTerm(java.lang.String _term)
Setter for the term.

Parameters:
_term - String containing the term for this posting list.

getTF

public int getTF()
Returns:
the term frequency.

setTF

public void setTF(int tf)
Setter for the term frequency.

Parameters:
tf - the new term frequency.

setPostingSource

public void setPostingSource(BitIn source)
Set where the postings should be read from


append

public abstract int append(BitOut bos,
                           int last,
                           int runShift)
                    throws java.io.IOException
Writes the document data of this posting to a BitOut It encodes the data with the right compression methods. The stream is written as d1, idf(d1) , d2 - d1, idf(d2) etc.

Parameters:
bos - BitOut to be written.
last - int representing the last document written in this posting.
Returns:
The last posting written.
Throws:
java.io.IOException

append

public int append(BitOut bos,
                  int last)
           throws java.io.IOException
Writes the document data of this posting to a BitOut It encodes the data with the right compression methods. The stream is written as d1, idf(d1) , d2 - d1, idf(d2) etc.

Parameters:
bos - BitOut to be written.
last - int representing the last document written in this posting.
Returns:
The last posting written.
Throws:
java.io.IOException

getPostingIterator

public abstract IterablePosting getPostingIterator(int runShift)
                                            throws java.io.IOException
Returns an IterablePosting object for the postings in this run

Throws:
java.io.IOException


Terrier 3.5. Copyright © 2004-2011 University of Glasgow