viktor.klang at gmail.com
Mon Oct 3 12:04:06 EDT 2011
On Mon, Oct 3, 2011 at 5:47 PM, Kasper Nielsen <kasper at kav.dk> wrote:
> On 03-10-2011 17:18, √iktor Ҡlang wrote:
>> The tie is the parameterized type signature of ? extends Hashable<K> &
>> smashing them together would really limit the usefulness and doesn't add
>> any value.
> I really do not see practically reason for separating these into 2
> different interfaces. Only more clutter.
You're a firm disbeliever is the Single Responsibility Principle?
The computation of the hashCode of the Key is distinctly something else from
comparing equality of Values.
> First of all, 90 % of all usage will be either Equivalence.Equals or
> Equivalence.Identity. With probably Equivalence.ignoreStringCase as a
> trailing third. These can all be predefined so users do not need to
> implement anything.
> Second, I think almost all usage will be in situations where you
> will also need the custom hash, for example, for keys in a hash map.
What? As I said, how does the equivalence-checking of the Values interact
with the hash of the Keys?
> See also
> CustomConcurrentHashMap.java<http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/extra166y/CustomConcurrentHashMap.java>which supports user-defined equivalence comparisons.
That is about the equivalence of the Keys, not of the Values.
> Guava has an identical interface com.google.common.base.**Equivalence.
I'd be surprised if there aren't thousands of similar implementations all
over the Java ecosystem due to the lack of it in the standard library.
> Concurrency-interest mailing list
> Concurrency-interest at cs.**oswego.edu <Concurrency-interest at cs.oswego.edu>
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest