Class SimpleTextTermVectorsReader
- java.lang.Object
-
- org.apache.lucene.codecs.TermVectorsReader
-
- org.apache.lucene.codecs.simpletext.SimpleTextTermVectorsReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Cloneable,Accountable
public class SimpleTextTermVectorsReader extends TermVectorsReader
Reads plain-text term vectors.FOR RECREATIONAL USE ONLY
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSimpleTextTermVectorsReader.SimpleTVDocsEnumprivate static classSimpleTextTermVectorsReader.SimpleTVFieldsprivate static classSimpleTextTermVectorsReader.SimpleTVPostingsprivate static classSimpleTextTermVectorsReader.SimpleTVPostingsEnumprivate static classSimpleTextTermVectorsReader.SimpleTVTermsprivate static classSimpleTextTermVectorsReader.SimpleTVTermsEnum
-
Field Summary
Fields Modifier and Type Field Description private static longBASE_RAM_BYTES_USEDprivate IndexInputinprivate long[]offsetsprivate BytesRefBuilderscratchprivate CharsRefBuilderscratchUTF16-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description SimpleTextTermVectorsReader(long[] offsets, IndexInput in)SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()Checks consistency of this reader.TermVectorsReaderclone()Create a clone that one caller at a time may use to read term vectors.voidclose()Fieldsget(int doc)Returns term vectors for this document, or null if term vectors were not indexed.private intparseIntAt(int offset)longramBytesUsed()Return the memory usage of this object in bytes.private voidreadIndex(int maxDoc)private voidreadLine()private java.lang.StringreadString(int offset, BytesRefBuilder scratch)java.lang.StringtoString()-
Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED
-
offsets
private long[] offsets
-
in
private IndexInput in
-
scratch
private BytesRefBuilder scratch
-
scratchUTF16
private CharsRefBuilder scratchUTF16
-
-
Constructor Detail
-
SimpleTextTermVectorsReader
public SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
SimpleTextTermVectorsReader
SimpleTextTermVectorsReader(long[] offsets, IndexInput in)
-
-
Method Detail
-
readIndex
private void readIndex(int maxDoc) throws java.io.IOException- Throws:
java.io.IOException
-
get
public Fields get(int doc) throws java.io.IOException
Description copied from class:TermVectorsReaderReturns term vectors for this document, or null if term vectors were not indexed. If offsets are available they are in anOffsetAttributeavailable from thePostingsEnum.- Specified by:
getin classTermVectorsReader- Throws:
java.io.IOException
-
clone
public TermVectorsReader clone()
Description copied from class:TermVectorsReaderCreate a clone that one caller at a time may use to read term vectors.- Specified by:
clonein classTermVectorsReader
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
readLine
private void readLine() throws java.io.IOException- Throws:
java.io.IOException
-
parseIntAt
private int parseIntAt(int offset)
-
readString
private java.lang.String readString(int offset, BytesRefBuilder scratch)
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
checkIntegrity
public void checkIntegrity() throws java.io.IOExceptionDescription copied from class:TermVectorsReaderChecks consistency of this reader.Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.
- Specified by:
checkIntegrityin classTermVectorsReader- Throws:
java.io.IOException
-
-