org.terrier.structures.postings
Class PostingUtil

java.lang.Object
  extended by org.terrier.structures.postings.PostingUtil

public class PostingUtil
extends java.lang.Object

Handy methods for Posting classes, such as obtaining all ids in a posting list, or selecting the minimum id in an array of posting lists.

Since:
3.0
Author:
Craig Macdonald

Constructor Summary
PostingUtil()
           
 
Method Summary
static int[] getIds(IterablePosting ip)
          Get an array of all the ids in a given IterablePosting stream
static int[] getIds(IterablePosting ip, int numPointers)
          Get an array of all the ids in a given IterablePosting stream, where the length of the stream is known
static int selectMinimumDocId(IterablePosting[] postingListArray)
          Returns the minimum docid of the current postings in the array of IterablePostings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostingUtil

public PostingUtil()
Method Detail

getIds

public static int[] getIds(IterablePosting ip)
                    throws java.io.IOException
Get an array of all the ids in a given IterablePosting stream

Throws:
java.io.IOException

getIds

public static int[] getIds(IterablePosting ip,
                           int numPointers)
                    throws java.io.IOException
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is known

Throws:
java.io.IOException

selectMinimumDocId

public static int selectMinimumDocId(IterablePosting[] postingListArray)
Returns the minimum docid of the current postings in the array of IterablePostings

Returns:
minimum docid, or -1 if all postings have ended.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow