File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 92

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: 19543
    
  16

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: 92
Thanks Rob ...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Alternate way of inserting the values in map?
 
Similar Threads
How to store two similar values
how to store multiple values in one key in hash table
Code to store null keys and null values in hashmap
Advice on comparing two text files
For good programming, In the Hasp Map programming, what value given to Key. As I know I can put any