Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures.indexing.singlepass
Class Posting

java.lang.Object
  extended by uk.ac.gla.terrier.structures.indexing.singlepass.Posting
Direct Known Subclasses:
BlockPosting, FieldPosting

public class Posting
extends java.lang.Object

Class representing a simple posting list in memory. It keeps the information for TF, Nt, and the sequence [doc, tf]

Author:
Roi Blanco

Constructor Summary
Posting()
           
 
Method Summary
 int getDocF()
           
 MemorySBOS getDocs()
           
 int getTF()
           
 int insert(int doc, int freq)
          Inserts a new document in the posting list.
 void setDocF(int docF)
          Set the document frequency the number of documents this term occurs in.
 void setDocs(MemorySBOS docs)
          Sets the document data compressed object.
 void setTF(int tf)
          Sets the term frequency in the run.
 void writeFirstDoc(int docId, int freq)
          Writes the first document in the posting list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Posting

public Posting()
Method Detail

writeFirstDoc

public void writeFirstDoc(int docId,
                          int freq)
                   throws java.io.IOException
Writes the first document in the posting list.

Parameters:
docId - the document identifier.
freq - the frequency of the term in the document.
Throws:
java.io.IOException - if an I/O error ocurrs.

insert

public int insert(int doc,
                  int freq)
           throws java.io.IOException
Inserts a new document in the posting list. Document insertions must be done in order.

Parameters:
doc - the document identifier.
freq - the frequency of the term in the document.
Returns:
the updated term frequency.
Throws:
java.io.IOException - if and I/O error occurs.

getTF

public int getTF()
Returns:
the term frequency of the term in the run

getDocs

public MemorySBOS getDocs()
Returns:
the document data compressed object.

setTF

public void setTF(int tf)
Sets the term frequency in the run.

Parameters:
tf - the term frequency.

setDocs

public void setDocs(MemorySBOS docs)
Sets the document data compressed object.

Parameters:
docs -

getDocF

public int getDocF()
Returns:
the document frequency - the number of documents this term occurs in

setDocF

public void setDocF(int docF)
Set the document frequency the number of documents this term occurs in.

Parameters:
docF - the document frequency.

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow