| 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
|
|
|
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
|
|
|
Have you come across BitSets? Would that help?
|
 |
 |
|
|
subject: get hashmap key from value
|
|
|