Sorting and categorise arraylist
<p>I want to sort Arraylist based on the field 'code' like below and i want to add an additional record  into the current arraylist with the value by total price of same code. </p>

<pre><code>No      Desc    Width      Height       Code        Price

1        WW     88.0        88.0      1021021       340.0       
4        TT     55.0        55.0      1021021       340.0       
5        PP     66.0        66.0      1021021       340.0   
2        gg     66.0        66.0      1021022       320.0       
3        LL     658.0       652.0     1021022       320.0
</code></pre>

<p>My expected output will be like this</p>

<pre><code>1        WW     88.0        88.0      1021021       340.0       
4        TT     55.0        55.0      1021021       340.0       
5        PP     66.0        66.0      1021021       340.0
                                                    1020
2        gg     66.0        66.0      1021022       320.0       
3        LL     658.0       652.0     1021022       320.0
                                                    640
</code></pre>

<p>Any one who can suggest the best way to solve this problem?.
thanks in advance.</p>
