org.terrier.structures.indexing.singlepass
Class BlockPosting

java.lang.Object
  extended by org.terrier.structures.indexing.singlepass.Posting
      extended by org.terrier.structures.indexing.singlepass.BlockPosting
Direct Known Subclasses:
BlockFieldPosting

public class BlockPosting
extends Posting

Class representing a posting list in memory with block information It keeps the information for DF, TF, and the sequence [doc, tf, blockCount, [blockId]]

Author:
Roi Blanco

Field Summary
 
Fields inherited from class org.terrier.structures.indexing.singlepass.Posting
docIds, lastInt, Nt, TF
 
Constructor Summary
BlockPosting()
           
 
Method Summary
 int insert(int doc, int freq, int[] blockids)
          Inserts a new document in the posting list.
 int writeFirstDoc(int doc, int frequency, int[] blockids)
          Writes the first document in the posting list.
 
Methods inherited from class org.terrier.structures.indexing.singlepass.Posting
getDocF, getDocs, getSize, getTF, insert, setDocF, setDocs, setTF, writeFirstDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockPosting

public BlockPosting()
Method Detail

writeFirstDoc

public int writeFirstDoc(int doc,
                         int frequency,
                         int[] blockids)
                  throws java.io.IOException
Writes the first document in the posting list.

Parameters:
doc - the document identifier.
frequency - the frequency of the term in the document.
blockids - the blockids for all the term
Throws:
java.io.IOException - if an I/O error ocurrs.

insert

public int insert(int doc,
                  int freq,
                  int[] blockids)
           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.
blockids - the blockids for all the term
Returns:
the updated term frequency.
Throws:
java.io.IOException - if and I/O error occurs.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow