I have three fields, namely
I am trying to write a function in java that returns a unique hash value (
I take it's a special version of hashCode. Otherwise you would need to overwrite hashCode
, don't define a new method. Containers like HashSet
don't get your own hash code.
long
, you do not need to use the xor (^) because it's already long. Just use the long
value.hashCode
of String with long
s for your purpose.(By the way, members should be called with lower letters and Time
should be private as well.)