public enum OptimisedBytesStoreHash extends Enum<OptimisedBytesStoreHash> implements BytesStoreHash<BytesStore>
This enumeration implements BytesStoreHash for optimized hashing of BytesStore depending on the size of the data and architecture of the system.
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
IS_LITTLE_ENDIAN |
static net.openhft.chronicle.core.Memory |
MEMORY |
| Modifier and Type | Method and Description |
|---|---|
long |
applyAsLong(@NotNull BytesStore store)
Hashes a BytesStore.
|
long |
applyAsLong(@NotNull BytesStore store,
long remaining)
Hashes a BytesStore of the given length.
|
static long |
applyAsLong32bytesMultiple(@NotNull BytesStore store,
int remaining)
Computes a 64-bit hash value for the given BytesStore for data sizes that are multiple of 32 bytes.
|
static long |
applyAsLongAny(@NotNull BytesStore store,
long remaining)
Computes a 64-bit hash value for the given BytesStore for any size of data.
|
static long |
hash(long l)
Performs a hash on a 64-bit long value.
|
static OptimisedBytesStoreHash |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OptimisedBytesStoreHash[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfhash, hash, hash32, hash32public static final OptimisedBytesStoreHash INSTANCE
public static final net.openhft.chronicle.core.Memory MEMORY
public static final boolean IS_LITTLE_ENDIAN
public static OptimisedBytesStoreHash[] values()
for (OptimisedBytesStoreHash c : OptimisedBytesStoreHash.values()) System.out.println(c);
public static OptimisedBytesStoreHash 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 long hash(long l)
l - The long value to hash.public static long applyAsLong32bytesMultiple(@NotNull
@NotNull BytesStore store,
int remaining)
throws BufferUnderflowException
store - The BytesStore to compute the hash for.remaining - The number of bytes to process.BufferUnderflowException - If there is not enough data.public static long applyAsLongAny(@NotNull
@NotNull BytesStore store,
long remaining)
throws BufferUnderflowException
store - The BytesStore to compute the hash for.remaining - The number of bytes to process.BufferUnderflowException - If there is not enough data.public long applyAsLong(@NotNull
@NotNull BytesStore store)
applyAsLong in interface ToLongFunction<BytesStore>store - the BytesStore to hash.public long applyAsLong(@NotNull
@NotNull BytesStore store,
long remaining)
throws IllegalStateException,
BufferUnderflowException
applyAsLong in interface BytesStoreHash<BytesStore>store - the BytesStore to hash.remaining - the length of content in BytesStore to hash.BufferUnderflowException - If buffer underflows during reading.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionCopyright © 2023. All rights reserved.