Package org.apache.lucene.util.packed
Enum Class PackedInts.Format
- All Implemented Interfaces:
Serializable,Comparable<PackedInts.Format>,Constable
- Enclosing class:
PackedInts
A format to write packed ints.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCompact format, all bits are written contiguously.Deprecated. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PackedInts.FormatbyId(int id) Get a format according to its ID.longbyteCount(int packedIntsVersion, int valueCount, int bitsPerValue) Computes how many byte blocks are needed to storevaluesvalues of sizebitsPerValue.intgetId()Returns the ID of the format.booleanisSupported(int bitsPerValue) Tests whether the provided number of bits per value is supported by the format.intlongCount(int packedIntsVersion, int valueCount, int bitsPerValue) Computes how many long blocks are needed to storevaluesvalues of sizebitsPerValue.floatoverheadPerValue(int bitsPerValue) Returns the overhead per value, in bits.final floatoverheadRatio(int bitsPerValue) Returns the overhead ratio (overhead per value / bits per value).static PackedInts.FormatReturns the enum constant of this class with the specified name.static PackedInts.Format[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PACKED
Compact format, all bits are written contiguously. -
PACKED_SINGLE_BLOCK
Deprecated.UsePACKEDinstead.A format that may insert padding bits to improve encoding and decoding speed. Since this format doesn't support all possible bits per value, you should never use it directly, but rather usePackedInts.fastestFormatAndBits(int, int, float)to find the format that best suits your needs.
-
-
Field Details
-
id
public final int id
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
byId
Get a format according to its ID. -
getId
public int getId()Returns the ID of the format. -
byteCount
public long byteCount(int packedIntsVersion, int valueCount, int bitsPerValue) Computes how many byte blocks are needed to storevaluesvalues of sizebitsPerValue. -
longCount
public int longCount(int packedIntsVersion, int valueCount, int bitsPerValue) Computes how many long blocks are needed to storevaluesvalues of sizebitsPerValue. -
isSupported
public boolean isSupported(int bitsPerValue) Tests whether the provided number of bits per value is supported by the format. -
overheadPerValue
public float overheadPerValue(int bitsPerValue) Returns the overhead per value, in bits. -
overheadRatio
public final float overheadRatio(int bitsPerValue) Returns the overhead ratio (overhead per value / bits per value).
-
PACKEDinstead.