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.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(byte[] packedValue, int docID) Add a new point from the packed value and docIdvoid
append
(PointValue pointValue) Add a new point from aPointValue
void
close()
int
computeCardinality
(int from, int to, int[] commonPrefixLengths) long
count()
Return the number of points in this writervoid
destroy()
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 aPointReader
iterator to step through all previously added pointsvoid
swap
(int i, int j) toString()
-
Field Details
-
block
public final byte[] block
-
-
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:PointWriter
Add a new point from the packed value and docId- Specified by:
append
in interfacePointWriter
-
append
Description copied from interface:PointWriter
Add a new point from aPointValue
- Specified by:
append
in interfacePointWriter
-
swap
public void swap(int i, int j) -
computeCardinality
public int computeCardinality(int from, int to, int[] commonPrefixLengths) -
count
public long count()Description copied from interface:PointWriter
Return the number of points in this writer- Specified by:
count
in interfacePointWriter
-
getReader
Description copied from interface:PointWriter
Returns aPointReader
iterator to step through all previously added points- Specified by:
getReader
in interfacePointWriter
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
destroy
public void destroy()Description copied from interface:PointWriter
Removes any temp files behind this writer- Specified by:
destroy
in interfacePointWriter
-
toString
-