I have a number of situations that call for a mapping between two types, but in every case the mapping goes both ways. It would be nice if there was such a thing as a bidirectional map, but as far as I can see if I want to reverse the direction of the mapping, I need to create another map object. Is that really the way it is?
First place to look for anything strange like that is Jakarta Commons. I presume you would have to go from the data representing a function to data representing an injective function.
Joined: May 13, 2009
Campbell Ritchie wrote:First place to look for anything strange like that is Jakarta Commons. I presume you would have to go from the data representing a function to data representing an injective function.
Thanks for the tip, I didn't know about that Jakarta stuff. Anyways, I take your answer a yes. All maps that are part of the java Collections group are one way maps. Hmm, it seems like such a small but useful thing to add, but i guess not.
Joined: Oct 13, 2005
If you hover your mouse over the link you find it is indeed a yes. Sun try their hardest and do provide lots of stuff, but there are lots of people who see holes in the provision and (more power to their elbow!) try to fill them. Remember Jakarta Commons is a good place to look for anything peculiar.