public static enum PackedInts.Format extends Enum<PackedInts.Format>
Enum Constant and Description |
---|
PACKED
Compact format, all bits are written contiguously.
|
PACKED_SINGLE_BLOCK
A format that may insert padding bits to improve encoding and decoding
speed.
|
Modifier and Type | Field and Description |
---|---|
int |
id |
Modifier and Type | Method and Description |
---|---|
static PackedInts.Format |
byId(int id)
Get a format according to its ID.
|
long |
byteCount(int packedIntsVersion,
int valueCount,
int bitsPerValue)
Computes how many byte blocks are needed to store
values
values of size bitsPerValue . |
int |
getId()
Returns the ID of the format.
|
boolean |
isSupported(int bitsPerValue)
Tests whether the provided number of bits per value is supported by the
format.
|
int |
longCount(int packedIntsVersion,
int valueCount,
int bitsPerValue)
Computes how many long blocks are needed to store
values
values of size bitsPerValue . |
float |
overheadPerValue(int bitsPerValue)
Returns the overhead per value, in bits.
|
float |
overheadRatio(int bitsPerValue)
Returns the overhead ratio (
overhead per value / bits per value ). |
static PackedInts.Format |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PackedInts.Format[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PackedInts.Format PACKED
public static final PackedInts.Format PACKED_SINGLE_BLOCK
PackedInts.fastestFormatAndBits(int, int, float)
to find the
format that best suits your needs.public static PackedInts.Format[] values()
for (PackedInts.Format c : PackedInts.Format.values()) System.out.println(c);
public static PackedInts.Format valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static PackedInts.Format byId(int id)
public int getId()
public long byteCount(int packedIntsVersion, int valueCount, int bitsPerValue)
values
values of size bitsPerValue
.public int longCount(int packedIntsVersion, int valueCount, int bitsPerValue)
values
values of size bitsPerValue
.public boolean isSupported(int bitsPerValue)
public float overheadPerValue(int bitsPerValue)
public final float overheadRatio(int bitsPerValue)
overhead per value / bits per value
).Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.