Help summing a arraylist
<p>Currently the code below will give me a line by line listing of the values, if i wanted to sum the values for one total, can someone give me an example of going about doing this?                                                                                      </p>

<pre><code>if (value != null &amp;&amp; !value.isEmpty()) {
    Set set = value.keySet();
    Object[] key = set.toArray();
    Arrays.sort(key);
    // System.out.println("test" + Arrays.asList(key));

    for (int i = 0; i &lt; key.length; i++) {
        // System.out.println(value.get((String)key[i]))
        ArrayList list = (ArrayList) value.get((String) key[i]);

        if (list != null &amp;&amp; !list.isEmpty()) {
            Iterator iter = list.iterator();
            double itemValue = 0;

            while (iter.hasNext()) {
                Iemunbuf p = (Itemunbuf) iter.next();

                if (p != null) {
                    propertyValue = itemValue + p.getitemValue().doubleValue();
                    System.out.println(itemValue);
                }

                // buf2.append(NL);
                buf2.append(t1 + "\t");
                // System.out.println(t1);
                buf2.append(NL);
            }

            buf1.append(NL);
            double amount = itemValue;
            buf1.append("  " + money.format(amount) + "  ");
        }
    }
}
</code></pre>
