title: Count the number of items in my array list
body: <p>I want to count the number of itemids in my array, can i get an example of how i would go about adding this to my code. code below;</p>
  
  <pre><code>if (value != null &amp;&amp; !value.isEmpty()) {
      Set set = value.keySet();
      Object[] key = set.toArray();
      Arrays.sort(key);
  
      for (int i = 0; i &lt; key.length; i++) {
          ArrayList list = (ArrayList) value.get((String) key[i]);
  
          if (list != null &amp;&amp; !list.isEmpty()) {
              Iterator iter = list.iterator();
              double itemValue = 0;
              String itemId = "";
  
              while (iter.hasNext()) {
                  Propertyunbuf p = (Propertyunbuf) iter.next();
                  if (p != null) {
                      itemValue = itemValue + p.getItemValue().doubleValue();
                      itemId = p.getItemId();
                  }
  
                  buf2.append(NL);
                  buf2.append("                  " + itemId);
  
              }
  
              double amount = itemValue;
              totalAmount += amount;
          }
      }
  }
  </code></pre>