i came across the use case to map
districts to postal codes which is a bidirectional many-to-many
relationship.
I investigated all "map"s i know about:
java.util.Map, is many-to-one (many different keys can point the same
value),
com.google.common.collect.BiMap, is one-to-one (every key and every
value is unique),
com.google.common.collect.Multimap, is many-to-many (one key can has
many values associated).
Multimap is the closest to what i want, but i need to keep two instances
in sync
to provide the bidirectionality:
Multimap<District, Zipcode> and Multimap<Zipcode, District>
An abstraction that would fit perfectly would be "BiMultimap" which
provides an inverse method
just like BiMap does.
What do you guys think. Is there a chance to get something like that
included into Guava?
Greetings
Willi
--
guava-...@googlegroups.com.
http://groups.google.com/group/guava-discuss?hl=en
unsubscribe: guava-discus...@googlegroups.com
This list is for discussion; for help, post to Stack Overflow instead:
http://stackoverflow.com/questions/ask
Use the tag "guava".
Dimitris:
If you're interested in graphs per se, take a look at JUNG
(http://jung.sf.net). If it's not what you want, feedback would be
great.
JUNG doesn't currently use Guava internally, but we're in the process
of creating a new version that does.
Joshua
--
Joshua O'Madadhain: Information Scientist, Musician, Philosopher-At-Tall
"It's that moment of dawning comprehension that I live for" -- Bill Watterson
Oops, that does ring a bell. Checking email archives. :P :)
Joshua