de.speexx.util
Class HashUtil

java.lang.Object
  extended by de.speexx.util.HashUtil

public class HashUtil
extends Object

Simple utilityclass for Object.hashCode() handling.

© Copyright 2006 Sascha Kohlmann under the terms of the GNU LGPL

Since:
2.1
Author:
Sascha Kohlmann
See Also:
EqualsUtil

Field Summary
static int SEED
          The base multiplier for has computing.
 
Constructor Summary
HashUtil()
           
 
Method Summary
static int hash(int seed, boolean bool)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, byte b)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, char c)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, double d)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, float f)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, int i)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, long l)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, Object obj)
          Computes an hash code object following the rules of Joshua Bloch.
static int hash(int seed, short s)
          Computes an hash code object following the rules of Joshua Bloch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEED

public static final int SEED
The base multiplier for has computing.

See Also:
Constant Field Values
Constructor Detail

HashUtil

public HashUtil()
Method Detail

hash

public static int hash(int seed,
                       boolean bool)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
bool - boolean value.
Returns:
a hash value

hash

public static int hash(int seed,
                       byte b)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
b - byte value.
Returns:
a hash value

hash

public static int hash(int seed,
                       char c)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
c - char value.
Returns:
a hash value

hash

public static int hash(int seed,
                       short s)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
s - short value.
Returns:
a hash value

hash

public static int hash(int seed,
                       int i)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
i - int value.
Returns:
a hash value

hash

public static int hash(int seed,
                       long l)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
l - long value.
Returns:
a hash value

hash

public static int hash(int seed,
                       float f)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
f - byte value.
Returns:
a hash value

hash

public static int hash(int seed,
                       double d)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
d - double value.
Returns:
a hash value

hash

public static int hash(int seed,
                       Object obj)
Computes an hash code object following the rules of Joshua Bloch.

Parameters:
seed - the seed.
obj - object value. Maybe an array.
Returns:
a hash value


Copyright © 2000-2006 SpeexX. All Rights Reserved.