Results 1 to 5 of 5
Thread: Changing the Value of a map
- 10-05-2011, 01:03 PM #1
Member
- Join Date
- Aug 2011
- Location
- Cornwall, UK
- Posts
- 22
- Rep Power
- 0
Changing the Value of a map
Map<Integer, Set<String>> a Map = etc....;
Having declared the map above correctly, if I wish to add a member to the existing Set of strings at a particular key is it sufficient to use:
Set<String> aSet;
aSet = aMap.get(Integer anInt);
aSet.add(aString);
Is the value of the key/value pairing now modified in aMap?
- 10-05-2011, 01:17 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: Changing the Value of a map
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-05-2011, 02:28 PM #3
Member
- Join Date
- Aug 2011
- Location
- Cornwall, UK
- Posts
- 22
- Rep Power
- 0
Re: Changing the Value of a map
Thanks Jos, just to finish it off, I assume that closing aSet does not affect the updated aMap.
TIA GT
- 10-05-2011, 02:30 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: Changing the Value of a map
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-05-2011, 02:31 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: Changing the Value of a map
When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Changing 8 to eight...need help!
By adjit in forum New To JavaReplies: 31Last Post: 06-18-2011, 09:47 PM -
changing TF formula
By o.imen in forum LuceneReplies: 0Last Post: 09-16-2010, 01:20 PM -
Changing binding when changing the underlying model object
By ChrisNY in forum NetBeansReplies: 0Last Post: 08-14-2010, 10:09 AM -
Changing Cursor
By ridvan in forum AWT / SwingReplies: 2Last Post: 06-27-2010, 04:11 AM -
Changing the Jframe
By Nemo1959 in forum New To JavaReplies: 13Last Post: 09-19-2008, 03:58 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks