title: Replace String values with value in Hash Map
body: <p>I'm new to Java Programming.  I have created a hash map that contains my Key Value pairs to utilize in replacing user input with the value corresponding to the respective key.  </p>
  
  <p>i.e. </p>
  
  <pre><code>        HashMap&lt;String,String&gt; questionKey = new HashMap&lt;&gt;();             
  
           for (item : itemSet()) {
               questionKey.put(String.valueOf(item.getOrder()+1), item.getKey());                                
           }                    
          String list = commandObject.getObjectItem().getList();
  
          if (list.contains("q")){                
              list.replaceAll("q01", questionKey.get("1"));               
              commandObject.getObjectItem().setList(list);
          }             
  </code></pre>
  
  <p>I am using this in a formula evaluation</p>
  
  <p><em>Note</em>: Users are given a certain formula specific way of entry (value1 + value2 + value3)</p>
  
  <p>I'm taking that (value1 value2 value3) and converting it to (value1key value2key value3key)</p>
  
  <p>Update: </p>
  
  <p>The Question as I understand it better now was meant to be to help better understand how to utilize a hashmap in order to evaluate user input. The more clear question would be </p>
  
  <p>What would be the best approach to evaluate an expression i.e.</p>
  
  <p>User Input = "var1 + var2" </p>
  
  <p>Expected Value: valueOf(var1) + valueOf(var2)</p>
  
  <p>?</p>