[concurrency-interest] Reference/IdentityMap toString

Kasper Nielsen kasper at kav.dk
Wed Aug 18 11:22:41 EDT 2010


On 17/08/10 04.23, Jason Mehrens wrote:
> Should the string representation of a map (entries and collection views)
> describe strictly just the contents or express the equivalence
> relationship of how the map views its entries? Specificity, since the
> CustomConcurrentHashMap can be created with an IDENTITY equivalence or
> EQUALS equivalence it would seem to me that one natural way to express
> this difference would be to have the map create an identityToString for
> a key or value when using an IDENTITY equivalence. Is it worth adding
> another method to CCHM.Equivalence to support custom strings?
>
Could you come up with some kind of usage scenario?

I can't recall i've ever used map.toString() for anything but debugging.
And if I ever wanted another string representation I would just copy the 
one from AbstractMap/AbstractCollection and customize it.

Cheers
   Kasper


More information about the Concurrency-interest mailing list