gate.creole.annic.apache.lucene.index
Class TermVectorsReader

java.lang.Object
  extended by gate.creole.annic.apache.lucene.index.TermVectorsReader

 class TermVectorsReader
extends Object

TODO: relax synchro!


Field Summary
private  FieldInfos fieldInfos
           
private  int size
           
private  InputStream tvd
           
private  InputStream tvf
           
private  InputStream tvx
           
 
Constructor Summary
TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos)
           
 
Method Summary
private  void checkValidFormat(InputStream in)
           
(package private)  void close()
           
(package private)  TermFreqVector[] get(int docNum)
          Return all term vectors stored for this document or null if the could not be read in.
(package private)  TermFreqVector get(int docNum, String field)
          Retrieve the term vector for the given document and field
private  SegmentTermVector readTermVector(String field, long tvfPointer)
           
private  SegmentTermVector[] readTermVectors(String[] fields, long[] tvfPointers)
           
(package private)  int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldInfos

private FieldInfos fieldInfos

tvx

private InputStream tvx

tvd

private InputStream tvd

tvf

private InputStream tvf

size

private int size
Constructor Detail

TermVectorsReader

TermVectorsReader(Directory d,
                  String segment,
                  FieldInfos fieldInfos)
            throws IOException
Throws:
IOException
Method Detail

checkValidFormat

private void checkValidFormat(InputStream in)
                       throws IOException
Throws:
IOException

close

void close()
     throws IOException
Throws:
IOException

size

int size()
Returns:
The number of documents in the reader

get

TermFreqVector get(int docNum,
                   String field)
Retrieve the term vector for the given document and field

Parameters:
docNum - The document number to retrieve the vector for
field - The field within the document to retrieve
Returns:
The TermFreqVector for the document and field or null

get

TermFreqVector[] get(int docNum)
Return all term vectors stored for this document or null if the could not be read in.


readTermVectors

private SegmentTermVector[] readTermVectors(String[] fields,
                                            long[] tvfPointers)
                                     throws IOException
Throws:
IOException

readTermVector

private SegmentTermVector readTermVector(String field,
                                         long tvfPointer)
                                  throws IOException
Parameters:
fieldNum - The field to read in
tvfPointer - The pointer within the tvf file where we should start reading
Returns:
The TermVector located at that position
Throws:
IOException