--- Janek Bogucki <[EMAIL PROTECTED]> wrote:
> On Tue, 2003-11-25 at 10:37, Phil Steitz wrote:
> > Thinking about this some more, the semantics of keySet() would be 
> > difficult with "CompositeMap" approach that I have suggested above.  We
> 
> > would either have to require that T be idempotent - i.e., T(T(x)) =
> T(x) 
> > or have the user supply a (partial) inverse transformer to return *a* 
> > pre-image for each transformed key.
> > 
> > Phil
> 
> Not quite sure if I understood your point entirely but it would not be
> possible to supply an inverse transformation for the lowercase operation
> because it is a many to one function. Perhaps you covered this with the
> word 'partial'  but I don't see what you mean by that. What's a partial
> inverse transformer?
> 

In the case of toLower(), the identity would work.  What I meant was a
function I satisfying T(I(T(x)) = T(x) -- so that the "inverse" would
return something that would, after transformation, map to the same value.
This function needs to select one of the (potentially many) pre-images of
each object in the range of the transformer. An example is the positive
square root as an "inverse" for the squaring function (or the identity as
"inverse" for toLower()).

This is probably not practical, so I guess either keySet() would be broken
(i.e., gets over the interated keySet would not traverse the values in the
Map)if the transformer is not idempotent or it would have to refer to the
underlying Map, which the decorator could expose.

Phil


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




__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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

Reply via email to