title: Filling Map - java
body: <p>I have problem with filling a <code>Map</code> in Java, I think this is simple, but I can't resolve this.</p>
  
  <p>Let's look at this:</p>
  
  <pre><code>Map&lt;Integer, HashMap&lt;String, String&gt;&gt; lineArrayData = new HashMap&lt;Integer, HashMap&lt;String, String&gt;&gt;();
  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
  String singleData[];
  
  int lineCounter = 0;
  for ( String line : this.lines )
  {
      singleData = line.split("\\|\\|");
  
      map.put("type", singleData[0]);
      map.put("text", singleData[1]);
      map.put("page", singleData[2]);
      map.put("x", singleData[3]);
      map.put("y", singleData[4]);
  
      lineArrayData.put(lineCounter, map);
  
      lineCounter++;
  }
  
  System.out.println(lineArrayData);
  </code></pre>
  
  <p>I have input </p>
  
  <pre><code>barcode||testowy test||1||100||100
  text||texttstdasd||2||500||300
  </code></pre>
  
  <p>and my output is:</p>
  
  <pre><code>{0={text=texttstdasd, page=2, type=text, y=300, x=500}, 1={text=texttstdasd, page=2, type=text, y=300, x=500}}
  </code></pre>
  
  <p>what have I done wrong?</p>