Package org.apache.lucene.util.bkd
Class HeapPointWriter
java.lang.Object
org.apache.lucene.util.bkd.HeapPointWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,PointWriter
Utility class to write new points into in-heap arrays.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(byte[] packedValue, int docID) Add a new point from the packed value and docIdvoidappend(PointValue pointValue) Add a new point from aPointValuevoidclose()intcomputeCardinality(int from, int to, int[] commonPrefixLengths) Computes the cardinality of the points betweenfromtptolongcount()Return the number of points in this writervoiddestroy()Removes any temp files behind this writergetPackedValueSlice(int index) Returns a reference, inresult, to the byte[] slice holding this valuegetReader(long start, long length) Returns aPointReaderiterator to step through all previously added pointstoString()
-
Constructor Details
-
HeapPointWriter
-
-
Method Details
-
getPackedValueSlice
Returns a reference, inresult, to the byte[] slice holding this value -
append
public void append(byte[] packedValue, int docID) Description copied from interface:PointWriterAdd a new point from the packed value and docId- Specified by:
appendin interfacePointWriter
-
append
Description copied from interface:PointWriterAdd a new point from aPointValue- Specified by:
appendin interfacePointWriter
-
computeCardinality
public int computeCardinality(int from, int to, int[] commonPrefixLengths) Computes the cardinality of the points betweenfromtpto -
count
public long count()Description copied from interface:PointWriterReturn the number of points in this writer- Specified by:
countin interfacePointWriter
-
getReader
Description copied from interface:PointWriterReturns aPointReaderiterator to step through all previously added points- Specified by:
getReaderin interfacePointWriter
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
destroy
public void destroy()Description copied from interface:PointWriterRemoves any temp files behind this writer- Specified by:
destroyin interfacePointWriter
-
toString
-