aspose file tools*
The moose likes Java in General and the fly likes Alternate way of inserting the values in map? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Alternate way of inserting the values in map?" Watch "Alternate way of inserting the values in map?" New topic
Author

Alternate way of inserting the values in map?

john sal
Ranch Hand

Joined: Jul 30, 2010
Posts: 93

is there any alternate way of doing the same in order to avoid the if check because if check is only valid once for each key map is containing and until the key not present in the map. Once the map contains the key the if check will no longer valid.
Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

Guava - ArrayListMultimap may be useful for you.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

And if you don't want or can't add that library, I always use the following:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
john sal
Ranch Hand

Joined: Jul 30, 2010
Posts: 93
Thanks Rob ...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Alternate way of inserting the values in map?