cameron-upright / rl-glue-ext

Automatically exported from code.google.com/p/rl-glue-ext
1 stars 0 forks source link

RL_abstract_type.hashCode() #78

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think that this method should be added to the code base. The default 
implementation of 
hashCode() returns a different value for different instantiations of objects. I 
think that 
RL_abstract_type should return a value based on its contents.

- John

Original issue reported on code.google.com by jasm...@gmail.com on 10 Jul 2009 at 5:57

GoogleCodeExporter commented 9 years ago
class RL_abstract_type {
  ...
  public int hashCode() {
    int C = Math.pow(2,some_number_of_bits_to_shift_hashCodes);
    return Arrays.hashCode(intArray)+C*Arrays.hashCode(doubleArray)+C*C*Arrays.hashCode(charArray);
  }
  ...
}

Original comment by jasm...@gmail.com on 10 Jul 2009 at 6:01