Package org.apache.lucene.util.packed
Class PackedInts.Writer
- java.lang.Object
-
- org.apache.lucene.util.packed.PackedInts.Writer
-
- Enclosing class:
- PackedInts
public abstract static class PackedInts.Writer extends Object
A write-once Writer.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description protected intbitsPerValueprotected DataOutputoutprotected intvalueCount
-
Constructor Summary
Constructors Modifier Constructor Description protectedWriter(DataOutput out, int valueCount, int bitsPerValue)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidadd(long v)Add a value to the stream.intbitsPerValue()The number of bits per value.abstract voidfinish()Perform end-of-stream operations.protected abstract PackedInts.FormatgetFormat()The format used to serialize values.abstract intord()Returns the current ord in the stream (number of values that have been written so far minus one).
-
-
-
Field Detail
-
out
protected final DataOutput out
-
valueCount
protected final int valueCount
-
bitsPerValue
protected final int bitsPerValue
-
-
Constructor Detail
-
Writer
protected Writer(DataOutput out, int valueCount, int bitsPerValue)
-
-
Method Detail
-
getFormat
protected abstract PackedInts.Format getFormat()
The format used to serialize values.
-
add
public abstract void add(long v) throws IOExceptionAdd a value to the stream.- Throws:
IOException
-
bitsPerValue
public final int bitsPerValue()
The number of bits per value.
-
finish
public abstract void finish() throws IOExceptionPerform end-of-stream operations.- Throws:
IOException
-
ord
public abstract int ord()
Returns the current ord in the stream (number of values that have been written so far minus one).
-
-