On Thu, 2003-12-04 at 07:54, Ceki GÃlcà wrote:
> Yes. The general contact for the hashcode method says:
> 
> 1 Two equal objects must have the same hashcode.
> 2 Two unequal objects can have the same hashcode.
> 
> Item 1 does *not* mean that unequal objects must have different hashcodes, 
> which is actually impossible to achieve.

Yes, sorry you are absolutely correct, that will work fine (you can see
why I stuffed up my versions can't you... :)  ).  

Having said that, it might not be the most efficient, as any
collection-style implementation which rely on 'buckets' will have those
with the same hashcode in the same bucket, and will then require a
linear search to locate them.  If we can keep them more distinct, it
might pay-off.

Now since the likelyhood of 2 events with exactly the same millisecond
is small (but not impossible if aggregating events from lots of places,
by say using a Receiver) maybe we should just tact on the hashCode of
the Message?

cheers,

Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to