org.davesag.generica.util
Class HashcodeMaker

java.lang.Object
  extended byorg.davesag.generica.util.HashcodeMaker

Deprecated. use org.apache.commons.lang.builder.HashCodeBuilder

public final class HashcodeMaker
extends Object

Methods which allow easy implementation of hashcode. This was inspired from recommendations in the book Effective Java , by Joshua Bloch.

Since:
Generica 1.0
Version:
CVS Revision $Id: HashcodeMaker.java,v 1.6 2004/04/08 13:19:08 davesag Exp $
Author:
Dave Sag http://www.davesag.com

Field Summary
static int SEED
          Deprecated. An initial value for a hashCode, to which is added contributions from fields.
 
Constructor Summary
HashcodeMaker()
          Deprecated.  
 
Method Summary
static int hash(int aSeed, boolean aBoolean)
          Deprecated. booleans.
static int hash(int aSeed, boolean[] aArray)
          Deprecated. Arrays of booleans.
static int hash(int aSeed, byte[] aArray)
          Deprecated. Arrays of bytes.
static int hash(int aSeed, char aChar)
          Deprecated. chars.
static int hash(int aSeed, char[] aArray)
          Deprecated. Arrays of chars.
static int hash(int aSeed, double aDouble)
          Deprecated. doubles.
static int hash(int aSeed, double[] aArray)
          Deprecated. Arrays of doubles.
static int hash(int aSeed, float aFloat)
          Deprecated. floats.
static int hash(int aSeed, float[] aArray)
          Deprecated. Arrays of floats.
static int hash(int aSeed, int aInt)
          Deprecated. integers.
static int hash(int aSeed, int[] aArray)
          Deprecated. Arrays of integers.
static int hash(int aSeed, long aLong)
          Deprecated. longs.
static int hash(int aSeed, long[] aArray)
          Deprecated. Arrays of longs
static int hash(int aSeed, Object aObject)
          Deprecated. Possibly-null Object fields.
static int hash(int aSeed, Object[] aArray)
          Deprecated. Arrays of Objects.
static int hash(int aSeed, short[] aArray)
          Deprecated. Arrays of shorts.
 
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
Deprecated. 
An initial value for a hashCode, to which is added contributions from fields. Using a non-zero value decreases collisons of hashCode values.

See Also:
Constant Field Values
Constructor Detail

HashcodeMaker

public HashcodeMaker()
Deprecated. 
Method Detail

hash

public static int hash(int aSeed,
                       boolean aBoolean)
Deprecated. 
booleans.

Parameters:
aSeed - seed number
aBoolean - boolean value
Returns:
hash code

hash

public static int hash(int aSeed,
                       char aChar)
Deprecated. 
chars.

Parameters:
aSeed - seed number
aChar - char value
Returns:
hash code

hash

public static int hash(int aSeed,
                       int aInt)
Deprecated. 
integers. Note that byte and short are handled by this method, through implicit conversion.

Parameters:
aSeed - seed number
aInt - int value
Returns:
hash code

hash

public static int hash(int aSeed,
                       long aLong)
Deprecated. 
longs.

Parameters:
aSeed - seed number
aLong - long value
Returns:
hash code

hash

public static int hash(int aSeed,
                       float aFloat)
Deprecated. 
floats.

Parameters:
aSeed - seed number
aFloat - float value
Returns:
hash code

hash

public static int hash(int aSeed,
                       double aDouble)
Deprecated. 
doubles.

Parameters:
aSeed - seed number
aDouble - double value
Returns:
hash code

hash

public static int hash(int aSeed,
                       Object aObject)
Deprecated. 
Possibly-null Object fields.

Parameters:
aSeed - seed number
aObject - object to hash.
Returns:
hash code

hash

public static int hash(int aSeed,
                       Object[] aArray)
Deprecated. 
Arrays of Objects.

Parameters:
aSeed - seed number
aArray - array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       boolean[] aArray)
Deprecated. 
Arrays of booleans.

Parameters:
aSeed - seed number
aArray - boolean array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       char[] aArray)
Deprecated. 
Arrays of chars.

Parameters:
aSeed - seed number
aArray - char array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       byte[] aArray)
Deprecated. 
Arrays of bytes.

Parameters:
aSeed - seed number
aArray - byte array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       short[] aArray)
Deprecated. 
Arrays of shorts.

Parameters:
aSeed - seed number
aArray - short array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       int[] aArray)
Deprecated. 
Arrays of integers.

Parameters:
aSeed - seed number
aArray - int array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       long[] aArray)
Deprecated. 
Arrays of longs

Parameters:
aSeed - seed number
aArray - long array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       float[] aArray)
Deprecated. 
Arrays of floats.

Parameters:
aSeed - seed number
aArray - float array to hash
Returns:
hash code

hash

public static int hash(int aSeed,
                       double[] aArray)
Deprecated. 
Arrays of doubles.

Parameters:
aSeed - seed number
aArray - double array to hash
Returns:
hash code


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.