org.terrier.structures.postings
Class BasicIterablePostingDocidOnly

java.lang.Object
  extended by org.terrier.structures.postings.BasicPostingImpl
      extended by org.terrier.structures.postings.BasicIterablePosting
          extended by org.terrier.structures.postings.BasicIterablePostingDocidOnly
All Implemented Interfaces:
java.io.Closeable, org.apache.hadoop.io.Writable, IterablePosting, Posting, WritablePosting

public class BasicIterablePostingDocidOnly
extends BasicIterablePosting

Posting iterator class that only returns identifiers, not frequencies. This differs from BasicIterablePosting in that only ids are recorded.

Since:
3.0
Author:
Craig Macdonald

Field Summary
 
Fields inherited from class org.terrier.structures.postings.BasicIterablePosting
bitFileReader, doi, numEntries
 
Fields inherited from class org.terrier.structures.postings.BasicPostingImpl
id, tf
 
Fields inherited from interface org.terrier.structures.postings.IterablePosting
EOL
 
Constructor Summary
BasicIterablePostingDocidOnly()
          Create a new posting iterator
BasicIterablePostingDocidOnly(BitIn _bitFileReader, int _numEntries, DocumentIndex _doi)
          Create a new posting iterator
 
Method Summary
 int getFrequency()
          Returns 0.
 int next()
          Move this iterator to the next posting.
 
Methods inherited from class org.terrier.structures.postings.BasicIterablePosting
asWritablePosting, close, endOfPostings, getDocumentLength, next
 
Methods inherited from class org.terrier.structures.postings.BasicPostingImpl
getId, readFields, setId, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.terrier.structures.postings.Posting
getId, setId
 

Constructor Detail

BasicIterablePostingDocidOnly

public BasicIterablePostingDocidOnly()
Create a new posting iterator


BasicIterablePostingDocidOnly

public BasicIterablePostingDocidOnly(BitIn _bitFileReader,
                                     int _numEntries,
                                     DocumentIndex _doi)
                              throws java.io.IOException
Create a new posting iterator

Parameters:
_bitFileReader - BitIn to read the postings from
_numEntries - number of postings in the list
_doi - document index to use to satisfy getDocumentLength()
Throws:
java.io.IOException - thrown in an IO exception occurs
Method Detail

next

public int next()
         throws java.io.IOException
Move this iterator to the next posting.

Specified by:
next in interface IterablePosting
Overrides:
next in class BasicIterablePosting
Returns:
id of next posting, or EOL if end of posting list
Throws:
java.io.IOException

getFrequency

public int getFrequency()
Returns 0.

Specified by:
getFrequency in interface Posting
Overrides:
getFrequency in class BasicPostingImpl
Returns:
frequency of posting, in tokens


Terrier 3.5. Copyright © 2004-2011 University of Glasgow