Results 1 to 2 of 2
  1. #1
    gtriant is offline Member
    Join Date
    Mar 2008
    Rep Power

    Default Hashmap - get key according to value

    hello! here is what i want from santa...

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


    Is there any way that i can get from my hashmap (in any kind of array or collection) the entries/keys/"facts" with value, say, only false??

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    Loop it and check. Try using the Map.Entry class and, from the Map, the getEntries method. That, at least, gives you the entries directly with a direct correlation between key and value, so you don't have to first retreive the key, in order to retreive the corresponding value, but can, rather check the value and then only pull the key if the value is in a range you want.

Similar Threads

  1. Hashmap to TXT and TXT to Hashmap
    By elvinny in forum Advanced Java
    Replies: 4
    Last Post: 02-17-2011, 12:12 AM
  2. hashmap
    By tOpach in forum New To Java
    Replies: 2
    Last Post: 09-24-2008, 01:55 PM
  3. Hashmap
    By dirtycash in forum New To Java
    Replies: 5
    Last Post: 12-03-2007, 03:58 AM
  4. what is hashmap
    By gabriel in forum New To Java
    Replies: 5
    Last Post: 08-03-2007, 02:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts