Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures
Class DirectIndexInputStream

java.lang.Object
  extended by uk.ac.gla.terrier.structures.DirectIndexInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
BlockDirectIndexInputStream

public class DirectIndexInputStream
extends java.lang.Object
implements Closeable

This class reads the direct index structure, sequentially, as an input stream.

Version:
$Revision: 1.29 $
Author:
Douglas Johnson, Vassilis Plachouras, Craig Macdonald
See Also:
DirectIndex

Constructor Summary
DirectIndexInputStream()
           
DirectIndexInputStream(java.lang.String path, java.lang.String prefix)
           
DirectIndexInputStream(java.lang.String path, java.lang.String prefix, DocumentIndexInputStream doiis)
           
 
Method Summary
 void close()
          Closes the underlying gamma compressed file.
 int getDocumentsSkipped()
          Returns the value of the documents that were skipped during a call to the method getNextTerms()
 int[][] getNextTerms()
          One call returns all the data for one document - [0][] is term ids, [1][] is frequency, [2][] is fields.
 int[][] getNextTerms(long endByteOffset, byte endBitOffset)
           
 void print()
          Prints out the html direct index file.
 void reOpenLegacyBitFile()
          forces the data structure to reopen the underlying bitfile using the legacy implementation of BitFile (OldBitFile)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectIndexInputStream

public DirectIndexInputStream()

DirectIndexInputStream

public DirectIndexInputStream(java.lang.String path,
                              java.lang.String prefix,
                              DocumentIndexInputStream doiis)

DirectIndexInputStream

public DirectIndexInputStream(java.lang.String path,
                              java.lang.String prefix)
Method Detail

reOpenLegacyBitFile

public void reOpenLegacyBitFile()
                         throws java.io.IOException
forces the data structure to reopen the underlying bitfile using the legacy implementation of BitFile (OldBitFile)

Throws:
java.io.IOException

getNextTerms

public int[][] getNextTerms()
                     throws java.io.IOException
One call returns all the data for one document - [0][] is term ids, [1][] is frequency, [2][] is fields. The size of [0,1,2][] is how many unique terms occur in each document. Between calls, use getDocumentsSkipped() to keep track of what docid you're currently processing.

Returns:
int[][] the two dimensional array containing the term ids, fields
Throws:
java.io.IOException - if an I/O error occurs

getNextTerms

public int[][] getNextTerms(long endByteOffset,
                            byte endBitOffset)
                     throws java.io.IOException
Throws:
java.io.IOException

print

public void print()
Prints out the html direct index file.


close

public void close()
Closes the underlying gamma compressed file.

Specified by:
close in interface Closeable

getDocumentsSkipped

public int getDocumentsSkipped()
Returns the value of the documents that were skipped during a call to the method getNextTerms()

Returns:
int the number of documents skipped.

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow