org.codehaus.groovy.util
Class HashCodeHelper

java.lang.Object
  extended by org.codehaus.groovy.util.HashCodeHelper

public class HashCodeHelper
extends java.lang.Object

A utility class to help calculate hashcode values using an algorithm similar to that outlined in "Effective Java, Joshua Bloch, 2nd Edition".


Field Summary
private static int MULT
           
private static int SEED
           
 
Constructor Summary
HashCodeHelper()
           
 
Method Summary
static int initHash()
           
private static int shift(int current)
           
static int updateHash(int current, boolean var)
           
static int updateHash(int current, boolean[] var)
           
static int updateHash(int current, byte[] var)
           
static int updateHash(int current, char var)
           
static int updateHash(int current, char[] var)
           
static int updateHash(int current, double var)
           
static int updateHash(int current, double[] var)
           
static int updateHash(int current, float var)
           
static int updateHash(int current, float[] var)
           
static int updateHash(int current, int var)
           
static int updateHash(int current, int[] var)
           
static int updateHash(int current, long var)
           
static int updateHash(int current, long[] var)
           
static int updateHash(int current, java.lang.Object var)
           
static int updateHash(int current, java.lang.Object[] var)
           
static int updateHash(int current, short[] var)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEED

private static final int SEED
See Also:
Constant Field Values

MULT

private static final int MULT
See Also:
Constant Field Values
Constructor Detail

HashCodeHelper

public HashCodeHelper()
Method Detail

initHash

public static int initHash()

updateHash

public static int updateHash(int current,
                             boolean var)

updateHash

public static int updateHash(int current,
                             char var)

updateHash

public static int updateHash(int current,
                             int var)

updateHash

public static int updateHash(int current,
                             long var)

updateHash

public static int updateHash(int current,
                             float var)

updateHash

public static int updateHash(int current,
                             double var)

updateHash

public static int updateHash(int current,
                             java.lang.Object var)

updateHash

public static int updateHash(int current,
                             boolean[] var)

updateHash

public static int updateHash(int current,
                             char[] var)

updateHash

public static int updateHash(int current,
                             byte[] var)

updateHash

public static int updateHash(int current,
                             short[] var)

updateHash

public static int updateHash(int current,
                             int[] var)

updateHash

public static int updateHash(int current,
                             long[] var)

updateHash

public static int updateHash(int current,
                             float[] var)

updateHash

public static int updateHash(int current,
                             double[] var)

updateHash

public static int updateHash(int current,
                             java.lang.Object[] var)

shift

private static int shift(int current)


Copyright © ${year} The Codehaus. All Rights Reserved.