Top Fields Constructors Methods
org.antlr.v4.runtime.misc

public final Class MurmurHash

extends Object
Class Inheritance

Author
Sam Harwell

Field Summary

Modifier and TypeField and Description
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the final hash result
finish
(int
the intermediate hash value
hash
,
int
the number of integer values added to the hash
numberOfWords
)

Apply the final computation steps to the intermediate value hash to form the final result of the MurmurHash 3 hash function.

public static <
the array element type
T
>
int

Returns:

the hash code of the data
hashCode
(T[]
the array data
data
,
int
the seed for the MurmurHash algorithm
seed
)

Utility function to compute the hash code of an array using the MurmurHash algorithm.

public static int

Returns:

the intermediate hash value
initialize
()

Initialize the hash using the default seed value.

public static int

Returns:

the intermediate hash value
initialize
(int
the seed
seed
)

Initialize the hash using the specified seed.

public static int

Returns:

the updated intermediate hash value
update
(int
the intermediate hash value
hash
,
int
the value to add to the current hash
value
)

Update the intermediate hash value for the next input value.

public static int

Returns:

the updated intermediate hash value
update
(int
the intermediate hash value
hash
,
Object
the value to add to the current hash
value
)

Update the intermediate hash value for the next input value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_SEEDback to summary
private static final int DEFAULT_SEED

Constructor Detail

MurmurHashback to summary
private MurmurHash()

Method Detail

finishback to summary
public static int finish(int hash, int numberOfWords)

Apply the final computation steps to the intermediate value hash to form the final result of the MurmurHash 3 hash function.

Parameters
hash:int

the intermediate hash value

numberOfWords:int

the number of integer values added to the hash

Returns:int

the final hash result

hashCodeback to summary
public static <T> int hashCode(T[] data, int seed)

Utility function to compute the hash code of an array using the MurmurHash algorithm.

Parameters
<T>
the array element type
data:T[]

the array data

seed:int

the seed for the MurmurHash algorithm

Returns:int

the hash code of the data

initializeback to summary
public static int initialize()

Initialize the hash using the default seed value.

Returns:int

the intermediate hash value

initializeback to summary
public static int initialize(int seed)

Initialize the hash using the specified seed.

Parameters
seed:int

the seed

Returns:int

the intermediate hash value

updateback to summary
public static int update(int hash, int value)

Update the intermediate hash value for the next input value.

Parameters
hash:int

the intermediate hash value

value:int

the value to add to the current hash

Returns:int

the updated intermediate hash value

updateback to summary
public static int update(int hash, Object value)

Update the intermediate hash value for the next input value.

Parameters
hash:int

the intermediate hash value

value:Object

the value to add to the current hash

Returns:int

the updated intermediate hash value