public final class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
checkSeedHashes(short seedHashA,
short seedHashB)
Checks the two given seed hashes.
|
static short |
computeSeedHash(long seed)
Computes and checks the 16-bit seed hash from the given long seed.
|
static long[] |
doubleToLongArray(double value)
Converts a double to a long[].
|
static int |
getStartingCapacity(int nomEntries,
int lgResizeFactor)
Gets the starting capacity of a new sketch given the Nominal Entries and the log Resize Factor.
|
static long |
stringArrHash(String[] strArray) |
static String |
stringConcat(String[] strArr)
Concatenate array of Strings to a single String.
|
static long |
stringHash(String s) |
static byte[] |
stringToByteArray(String value)
Converts a String to a UTF_8 byte array.
|
public static final long[] doubleToLongArray(double value)
value
- the given double valuepublic static final byte[] stringToByteArray(String value)
value
- the given String valuepublic static short computeSeedHash(long seed)
seed
- See Update Hash Seedpublic static final void checkSeedHashes(short seedHashA, short seedHashB)
seedHashA
- given seed hash AseedHashB
- given seed hash Bpublic static int getStartingCapacity(int nomEntries, int lgResizeFactor)
nomEntries
- the given Nominal EntrieslgResizeFactor
- the given log Resize Factorpublic static String stringConcat(String[] strArr)
strArr
- the given String arraypublic static long stringHash(String s)
s
- the string to hashpublic static long stringArrHash(String[] strArray)
strArray
- array of StringsCopyright © 2015–2021 The Apache Software Foundation. All rights reserved.