You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Kestle <st...@orionhealth.com> on 2007/01/05 02:12:00 UTC

Re: [Collections] Equator interface (and FlexiMap)

Stephen Colebourne wrote:
> BTW, I favour trying to create a 'FlexiMap' map implementation, which 
> has pluggable hashcode/equals/weakReference/softReference/... So, if 
> anyone wants to give that a go feel free!
>
> Stephen
In my current code, I have an Equator (equalTo()) method, and a 
HashEquator (extends Equator and adds a hash() method), but now that 
I've gone and implemented stuff, it comes down to the fact that nothing 
uses Equator directly, because so many things use hash codes etc, that 
you're just shooting yourself in the foot later by not following a 
similar contract to the Object.equals() method.  Thus there will only be 
one plug for hashcode/equals implementation (hopefully just clarifying 
what you were thinking).

What I also was going to say is that you can use an EquatorMap and 
ReferenceMap to decorate each other, but they're going to extend from 
different classes, so that's no good.

So, are you talking about one Map to rule them all?  Sounds convenient.

Stephen (not C :)


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org