What about this? Map union = new Map(); union.putAll( mapA ); union.putAll( mapB );
Mappings in mapB would be preferred when there is a common mapping. K.C. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, February 24, 2003 9:46 AM > To: Jakarta Commons Users List > Subject: Map Union > > > > hi, > > is there any API like > > Map myUnion = Map.union(mapA, mapB) > > that returns a map that contains as its keySet the disjoint > union of the > keysets of mapA and mapB, mapping to the values that the key > originally > mapped to under A or B. (with either undefined behaviour for > common keys or > throwing an exception)? > > thanks, > Andrew > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
