hash map filter to generate multiple list of keys

I really like to know other than iterate over through the java hash-map again and again, is there any direct way to generate a list of keys based on combined value criteria, like in my case I want those keys whose total sum of all value should be equal to or smaller to 100 (max-size)

I know I am not good to make statement correct but here is an example to clarify what I try to achieve

This is the input program :

int max_size = 100;

HashMap cache = new HashMap

Read More »

By: StackOverFlow - Friday, 13 April

Related Posts

  • Older News
  • Creating Independent Hash Functions StackOverFlow (Yesterday) - I need to create two independent hash functions to implement a bloom filter in java.These two hash functions h_1(x) and h_2(x) will be used to simulate additional hash functions when...
  • How to add specific values from array list to the Hash map? StackOverFlow (3 days ago) - Here is what I tried:HashMap hmap = new HashMap();List valueList = new ArrayList();valueList.add(9);valueList.add(8);valueList.add(7);valueList.add(6);hmap.put("A", valueList);valueList.add(5);valueList.add(4);valueList.add(3);valueList.add(2);hmap.put("B", valueList);valueList.add(7);valueList.add(6);valueList.add(5);valueList.add(4);hmap.put("C", valueList);valueList.add(2);valueList.add(3);valueList.add(4);valueList.add(5);hmap.put("D", valueList);When I try to retive the values of a specific key key...
  • gpg --list-keys is empty but file decrypts bouncycastle encrypted file StackOverFlow (3 days ago) - I am currently using BouncyCastle PGP in a Java application to read a public key from a string, and encrypt a file using that key. Loading the key...Security.addProvider(new BouncyCastleProvider());InputStream keyIn...