[concurrency-interest] ConcurrentHashMapV8

Mark Thornton mthornton at optrak.com
Mon Oct 3 10:22:15 EDT 2011


On 03/10/11 14:34, √iktor Ҡlang wrote:
> Hi Doug,
>
> I'd love to be able to specify a Comparator in the constructor so that 
> conditional remove doesn't rely on reference-equality or .equals 
> (since oftentimes I cannot overload it)
>
> Thoughts?
>
> Cheers,
>A Comparator wouldn't be appropriate for a HashMap. What you need is 
something like:

interface Equivalence<T> {
     int hash(T value);
     boolean isEqual(T a, T b);
}

Mark



More information about the Concurrency-interest mailing list