I get this Map from a collection and collection might have 1000 or more  Maps 
so I first iterate over this  collection retrieve the map and  then iterate 
over this map  so creating a new Map for each  iteration  is this a good design 
?
Thanks & Regards
  
Antonio Petrelli <[EMAIL PROTECTED]> wrote:  temp temp ha scritto:
>     I have a  HashMap   with some data .I must alter  the Map by replacing 
> the keys with their upper case.
Ok first of all you cannot modify a HashMap while you are iterating it. 
But your problem has a solution.
Iterate the map and store into another map the key-value pair (with the 
key turned to uppercase)
Then clear the original map and then call "putAll"


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



                
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Reply via email to