aspose file tools
The moose likes Java in General and the fly likes get hashmap key from value Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "get hashmap key from value" Watch "get hashmap key from value" New topic
Author

get hashmap key from value

Greg Triant
Greenhorn

Joined: Nov 25, 2007
Posts: 25
hello! here is what i want from santa...

i have a hashmap with string-boolean as key/value pairs.
sth like:

"fact1"-true
"fact2"-false
"fact3"-false
"fact4"-true
etc...

Is there any way that i can get in any kind of array or collection the entries/keys/"facts" with value, say, only false??
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24048
    
  13

Only by iterating through the map and collecting the entries with the given value into a list. Easy enough to do!


[Jess in Action][AskingGoodQuestions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32638
    
    4
Have you come across BitSets? Would that help?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: get hashmap key from value
 
Similar Threads
Data corruption
display dynamically
Multi-threads access singleton
What is wrong with this code?
Regarding Bulk insert