public class LcpMonotoneMinimalPerfectHashFunction<T> extends AbstractHashFunction<T> implements Size64, Serializable
See the package overview for a comparison with other implementations.
Similarly to a GOV3Function, an instance of this class may be signed.
| Modifier and Type | Class and Description |
|---|---|
static class |
LcpMonotoneMinimalPerfectHashFunction.Builder<T>
A builder class for
LcpMonotoneMinimalPerfectHashFunction. |
| Modifier and Type | Field and Description |
|---|---|
protected int |
bucketSize
The size of a bucket.
|
protected int |
bucketSizeMask
The mask for
log2BucketSize bits. |
protected GOV3Function<BitVector> |
lcp2Bucket
A function mapping each longest common prefix to its bucket.
|
protected int |
log2BucketSize
|
protected long |
n
The number of keys.
|
protected GOV3Function<BitVector> |
offsetLcpLength
A function mapping each key to the offset inside its bucket (lowest
log2BucketSize bits) and
to the length of the longest common prefix of its bucket (remaining bits). |
protected long |
seed
The seed returned by the
ChunkedHashStore. |
static long |
serialVersionUID |
protected long |
signatureMask
The mask to compare signatures, or zero for no signatures.
|
protected LongBigList |
signatures
The signatures.
|
protected TransformationStrategy<? super T> |
transform
The transformation strategy.
|
defRetValue| Modifier | Constructor and Description |
|---|---|
protected |
LcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> keys,
long numKeys,
TransformationStrategy<? super T> transform,
int signatureWidth,
File tempDir)
Creates a new LCP monotone minimal perfect hash function for the given keys.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLong(Object o) |
static void |
main(String[] arg) |
long |
numBits()
Returns the number of bits used by this structure.
|
long |
size64() |
containsKey, sizeclear, defaultReturnValue, defaultReturnValue, get, put, put, remove, removeLongpublic static final long serialVersionUID
protected final long n
protected final int bucketSize
protected final int log2BucketSize
protected final int bucketSizeMask
log2BucketSize bits.protected final GOV3Function<BitVector> offsetLcpLength
log2BucketSize bits) and
to the length of the longest common prefix of its bucket (remaining bits).protected final GOV3Function<BitVector> lcp2Bucket
protected final TransformationStrategy<? super T> transform
protected final long seed
ChunkedHashStore.protected final long signatureMask
protected final LongBigList signatures
protected LcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> keys, long numKeys, TransformationStrategy<? super T> transform, int signatureWidth, File tempDir) throws IOException
keys - the keys to hash.numKeys - the number of keys, or -1 if the number of keys is not known (will be computed).transform - a transformation strategy for the keys.signatureWidth - a signature width, or 0 for no signature.tempDir - a temporary directory for the store files, or null for the standard temporary directory.IOExceptionpublic long getLong(Object o)
getLong in interface Object2LongFunction<T>public long size64()
size64 in interface Size64size64 in class AbstractHashFunction<T>public long numBits()
public static void main(String[] arg) throws NoSuchMethodException, IOException, JSAPException