public final class HeapPointWriter extends java.lang.Object implements PointWriter
Modifier and Type | Field and Description |
---|---|
byte[] |
block |
private boolean |
closed |
int[] |
docIDs |
private int |
nextWrite |
(package private) int |
packedBytesLength |
private HeapPointReader.HeapPointValue |
pointValue |
private byte[] |
scratch |
(package private) int |
size |
Constructor and Description |
---|
HeapPointWriter(int size,
int packedBytesLength) |
Modifier and Type | Method and Description |
---|---|
void |
append(byte[] packedValue,
int docID)
Add a new point from the packed value and docId
|
void |
append(PointValue pointValue)
Add a new point from a
PointValue |
void |
close() |
long |
count()
Return the number of points in this writer
|
void |
destroy()
Removes any temp files behind this writer
|
PointValue |
getPackedValueSlice(int index)
Returns a reference, in
result , to the byte[] slice holding this value |
PointReader |
getReader(long start,
long length)
Returns a
PointReader iterator to step through all previously added points |
void |
swap(int i,
int j) |
java.lang.String |
toString() |
public final int[] docIDs
public final byte[] block
final int size
final int packedBytesLength
private final byte[] scratch
private int nextWrite
private boolean closed
private HeapPointReader.HeapPointValue pointValue
public PointValue getPackedValueSlice(int index)
result
, to the byte[] slice holding this valuepublic void append(byte[] packedValue, int docID)
PointWriter
append
in interface PointWriter
public void append(PointValue pointValue)
PointWriter
PointValue
append
in interface PointWriter
public void swap(int i, int j)
public long count()
PointWriter
count
in interface PointWriter
public PointReader getReader(long start, long length)
PointWriter
PointReader
iterator to step through all previously added pointsgetReader
in interface PointWriter
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public void destroy()
PointWriter
destroy
in interface PointWriter
public java.lang.String toString()
toString
in class java.lang.Object