Class Lucene40StoredFieldsReader
- java.lang.Object
 - 
- org.apache.lucene.codecs.StoredFieldsReader
 - 
- org.apache.lucene.codecs.lucene40.Lucene40StoredFieldsReader
 
 
 
- 
- All Implemented Interfaces:
 java.io.Closeable,java.lang.AutoCloseable,java.lang.Cloneable
public final class Lucene40StoredFieldsReader extends StoredFieldsReader implements java.lang.Cloneable, java.io.Closeable
Class responsible for access to stored document fields. It uses <segment>.fdt and <segment>.fdx; files.- See Also:
 Lucene40StoredFieldsFormat
 
- 
- 
Constructor Summary
Constructors Constructor Description Lucene40StoredFieldsReader(Directory d, SegmentInfo si, FieldInfos fn, IOContext context)Sole constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Lucene40StoredFieldsReaderclone()Returns a cloned FieldsReader that shares open IndexInputs with the original one.voidclose()Closes the underlyingIndexInputstreams.longramBytesUsed()Returns approximate RAM bytes usedIndexInputrawDocs(int[] lengths, int startDocID, int numDocs)Returns the length in bytes of each raw document in a contiguous range of length numDocs starting with startDocID.intsize()Returns number of documents.voidvisitDocument(int n, StoredFieldVisitor visitor)Visit the stored fields for documentn 
 - 
 
- 
- 
Constructor Detail
- 
Lucene40StoredFieldsReader
public Lucene40StoredFieldsReader(Directory d, SegmentInfo si, FieldInfos fn, IOContext context) throws java.io.IOException
Sole constructor.- Throws:
 java.io.IOException
 
 - 
 
- 
Method Detail
- 
clone
public Lucene40StoredFieldsReader clone()
Returns a cloned FieldsReader that shares open IndexInputs with the original one. It is the caller's job not to close the original FieldsReader until all clones are called (eg, currently SegmentReader manages this logic).- Specified by:
 clonein classStoredFieldsReader
 
- 
close
public final void close() throws java.io.IOExceptionCloses the underlyingIndexInputstreams. This means that the Fields values will not be accessible.- Specified by:
 closein interfacejava.lang.AutoCloseable- Specified by:
 closein interfacejava.io.Closeable- Throws:
 java.io.IOException- If an I/O error occurs
 
- 
size
public final int size()
Returns number of documents. 
- 
visitDocument
public final void visitDocument(int n, StoredFieldVisitor visitor) throws java.io.IOExceptionDescription copied from class:StoredFieldsReaderVisit the stored fields for documentn- Specified by:
 visitDocumentin classStoredFieldsReader- Throws:
 java.io.IOException
 
- 
rawDocs
public final IndexInput rawDocs(int[] lengths, int startDocID, int numDocs) throws java.io.IOException
Returns the length in bytes of each raw document in a contiguous range of length numDocs starting with startDocID. Returns the IndexInput (the fieldStream), already seeked to the starting point for startDocID.- Throws:
 java.io.IOException
 
- 
ramBytesUsed
public long ramBytesUsed()
Description copied from class:StoredFieldsReaderReturns approximate RAM bytes used- Specified by:
 ramBytesUsedin classStoredFieldsReader
 
 - 
 
 -