commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baltz, Kenneth" <Kba...@firstam.com>
Subject RE: Map Union
Date Mon, 24 Feb 2003 18:27:20 GMT
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: Andrew.Ferguson@arm.com [mailto:Andrew.Ferguson@arm.com]
> 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: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message