org.terrier.structures.postings
Interface Posting

All Known Subinterfaces:
BitWritablePosting, BlockPosting, FieldPosting, IterablePosting, WritablePosting
All Known Implementing Classes:
ArrayOfBasicIterablePosting, ArrayOfIdsIterablePosting, BasicIterablePosting, BasicIterablePostingDocidOnly, BasicPostingImpl, BlockFieldIterablePosting, BlockFieldORIterablePosting, BlockFieldPostingImpl, BlockFieldPostingInRun.bfPIRPostingIterator, BlockIterablePosting, BlockORIterablePosting, BlockPostingImpl, BlockPostingInRun.BlockPIRPostingIterator, DocumentPostingList.postingIterator, FieldIterablePosting, FieldORIterablePosting, FieldPostingImpl, FieldPostingInRun.fPIRPostingIterator, IterablePostingImpl, ORIterablePosting, SimplePostingInRun.PIRPostingIterator

public interface Posting

This interface represents one posting in a posting list. From a Posting object, the id of the posting list entry (e.g. document id for inverted index, or term id for direct index), the frequency, and the length of the document can be accessed.

Since:
3.0
Author:
Craig Macdonald

Method Summary
 WritablePosting asWritablePosting()
          Copies this posting to one free of an iterator.
 int getDocumentLength()
          Return the length of the document for this posting.
 int getFrequency()
          Return the frequency of the term in the current document
 int getId()
          Return the id of the current posting.
 void setId(int id)
          It may be of benefit to update the frequency of the id in some applications.
 

Method Detail

getId

int getId()
Return the id of the current posting. For the inverted index, this is the docid; for the direct index it corresponds to the term id

Returns:
id of the posting

getFrequency

int getFrequency()
Return the frequency of the term in the current document

Returns:
frequency of posting, in tokens

getDocumentLength

int getDocumentLength()
Return the length of the document for this posting. Usually uses the DocumentIndex, may do otherwise if document length statistics are in posting list

Returns:
length of the document of the current posting in tokens.

setId

void setId(int id)
It may be of benefit to update the frequency of the id in some applications. This should not be used lightly, as it may break the decompression of other postings in iterators.


asWritablePosting

WritablePosting asWritablePosting()
Copies this posting to one free of an iterator. Kind of like a clone.

Returns:
an identical posting, but which can be maniulated free of this iterator


Terrier 3.5. Copyright © 2004-2011 University of Glasgow