TV-Browser 3.3.3 API

util.misc
Class HashCodeUtilities

java.lang.Object
  extended by util.misc.HashCodeUtilities

public final class HashCodeUtilities
extends java.lang.Object

Collected methods which allow easy implementation of hashCode. Example use case:

 public int hashCode() {
   int result = HashCodeUtil.hash(someField);
   result = HashCodeUtil.hash(result, fPrimitive);
   result = HashCodeUtil.hash(result, fObject);
   result = HashCodeUtil.hash(result, fArray);
   return result;
 }
 


Constructor Summary
HashCodeUtilities()
           
 
Method Summary
static int hash(boolean value)
           
static int hash(char value)
           
static int hash(double value)
           
static int hash(float value)
           
static int hash(int value)
           
static int hash(int aSeed, boolean aBoolean)
          booleans.
static int hash(int aSeed, char aChar)
          chars.
static int hash(int aSeed, double aDouble)
          doubles.
static int hash(int aSeed, float aFloat)
          floats.
static int hash(int aSeed, int aInt)
          ints.
static int hash(int aSeed, long aLong)
          longs.
static int hash(int seed, java.lang.Object object)
          aObject is a possibly-null object field, and possibly an array.
static int hash(long value)
           
static int hash(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashCodeUtilities

public HashCodeUtilities()
Method Detail

hash

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


hash

public static int hash(boolean value)

hash

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


hash

public static int hash(char value)

hash

public static int hash(int aSeed,
                       int aInt)
ints.


hash

public static int hash(int value)

hash

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


hash

public static int hash(long value)

hash

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


hash

public static int hash(float value)

hash

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


hash

public static int hash(double value)

hash

public static int hash(int seed,
                       java.lang.Object object)
aObject is a possibly-null object field, and possibly an array. If aObject is an array, then each element may be a primitive or a possibly-null object.


hash

public static int hash(java.lang.Object value)

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)