Terrier IR Platform
1.1.1

uk.ac.gla.terrier.structures.indexing
Class DocumentPostingList

java.lang.Object
  extended by uk.ac.gla.terrier.structures.indexing.DocumentPostingList
Direct Known Subclasses:
BlockDocumentPostingList

public class DocumentPostingList
extends java.lang.Object

Represents the postings of one document. Uses HashMaps internally.

Properties:


Constructor Summary
DocumentPostingList()
          Make a new postings list for a document.
DocumentPostingList(int fieldCount)
          Make a new postings list for a document, with the specified number of fields
 
Method Summary
 void clear()
          Removes all postings from this document
 int getDocumentLength()
          Returns the total number of tokens in this document
 int getNumberOfPointers()
          Returns the number of unique terms in this document.
 int[][] getPostings()
          returns the postings suitable to be written into the direct index
 void insert(java.lang.String term)
          Insert a term into the posting list of this document
 void insert(java.lang.String term, int fieldNum)
          Insert a term into the posting list of this document, in the given field
 void insert(java.lang.String term, int[] fieldNums)
          Insert a term into the posting list of this document, in the given field
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentPostingList

public DocumentPostingList()
Make a new postings list for a document. No fields


DocumentPostingList

public DocumentPostingList(int fieldCount)
Make a new postings list for a document, with the specified number of fields

Parameters:
fieldCount - number of fields marked in this index
Method Detail

clear

public void clear()
Removes all postings from this document


getDocumentLength

public int getDocumentLength()
Returns the total number of tokens in this document


getNumberOfPointers

public int getNumberOfPointers()
Returns the number of unique terms in this document.


insert

public void insert(java.lang.String term)
Insert a term into the posting list of this document

Parameters:
term - the Term being inserted

insert

public void insert(java.lang.String term,
                   int fieldNum)
Insert a term into the posting list of this document, in the given field

Parameters:
term - the Term being inserted
fieldNum - the id of the field that the term was found in

insert

public void insert(java.lang.String term,
                   int[] fieldNums)
Insert a term into the posting list of this document, in the given field

Parameters:
term - the Term being inserted
fieldNums - the ids of the fields that the term was found in

getPostings

public int[][] getPostings()
returns the postings suitable to be written into the direct index


Terrier IR Platform
1.1.1

Terrier Information Retrieval Platform 1.1.1. Copyright 2004-2007 University of Glasgow