title: How do I add and remove items from a multivalue HashMap?
body: <p>I am trying to add values to a multivalue HashMap which is of the following structure:</p>
  
  <pre><code>Map&lt; Integer, List&lt;Float&gt; &gt; map = new HashMap&lt; Integer, List&lt;Float&gt; &gt;();
  </code></pre>
  
  <p>I actually wanted to hold a reference to a particular item (A View's info in Android for e.g.), so the <code>Integer</code> value of the <code>HashMap</code> will contain the items <code>ID</code> which is unique, the <code>List</code> of <code>Float</code>s will contain the items X coordinate values. The user can have many items on the screen, he can also have 100 items with same ID, so accordingly the List will contain each Items X coordinate value.</p>
  
  <p>To be more clear my HashMap will contain the following data</p>
  
  <p>{1,{200, 400.5, 500.6 ...}}, where 1 is the key and the rest are Float values for Item with ID 1.</p>
  
  <p>Right now I add the List values as follows...</p>
  
  <pre><code>List&lt;Float&gt; list = new ArrayList&lt;Float&gt;();
  
  list.add(x_coord_1);
  list.add(x_coord_2);
  list.add(x_coord_3)
  map.put(1, list);
  </code></pre>
  
  <p>The problem I am facing now is figuring out as of how can I instantiate a new List everytime a new ID is created..</p>
  
  <p>I would have to create 100 List's for 100 items which is not feasible, not knowing the number of ID's..</p>
  
  <p>Is there a better approach to solve this issue... </p>
  
  <p>Also I wanted to find a way to delete a specific value of a particular key from the <code>HashMap</code></p>