title: Add value without using index in 2D arrayList inside a HashMap, Java
body: <p>I'm fairly new to ArrayLists anyway but I need them for this simulation project I'm doing so if you guys could help me I would be more than grateful!</p>
  
  <p>I have a HashMap of 2D arrayLists which should be filled with "value" and "time" in every iteration of simulation based on a String key. I define my variable as follow:</p>
  
  <pre><code>protected Map&lt;String, ArrayList&lt;ArrayList&lt;Object&gt;&gt;&gt; history = new HashMap&lt;String,ArrayList&lt;ArrayList&lt;Object&gt;&gt;&gt;();
  </code></pre>
  
  <p>, and I initialize it like this:</p>
  
  <pre><code>for (String act:keySet)  
     history.put(act, new ArrayList&lt;ArrayList&lt;Object&gt;&gt;());
  </code></pre>
  
  <p>Every ArrayList of my Map has two arrayList, and in every iteration I should add my "value", and "time" in every arrayList, so I can store my data and its respective time together, but I don't know how to use key, call my arraylist without using index like in normal arrayList when we can do like this:</p>
  
  <pre><code>tmpData.add("foobar"); // Example
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Vahid</p>