title: Java iterate over hashmap 2 levels
body: <p>I have this class:</p>
  
  <pre><code>    public class docInfo {
          private int freq;
          private HashMap&lt;String, Double&gt; m = new HashMap&lt;String, Double&gt;();
      }
  
      private Map&lt;String, docInfo&gt; m;
  </code></pre>
  
  <p>I want to iterate over all the docInfo's Double value and change it:</p>
  
  <pre><code>docInfo documento;
  
   for (Map.Entry&lt;String, docInfo&gt; entry : m.entrySet()) {
              word = entry.getKey();            
              docs = entry.getValue(); // docs map
  
  
              for (Map.Entry&lt;String, Double&gt; entry2 : docs.getM().entrySet()){  
  
                  score = entry2.getValue(); 
                  temp = score;
  
                  double log = Math.log10(docs.getFreq());
                  double tfw = log+cons;
  
                  docs.changeScoreTo(entry2.getKey(), tfw);
                  //entry2.setValue(tfw);
  
          }
          }
  </code></pre>
  
  <p>It is working, the problem is, it is taking too long to run and i think my code is not the fittest for the job. Any help would be appreciated,</p>