I have an xml that looks like :
<Order OrderNo="1">
<OrderLines LineNo="1" Qty="10"/>
<OrderLines LineNo="2" Qty="7"/>
<OrderLines LineNo="3" Qty="10"/>
<OrderLines LineNo="4" Qty="4"/>
<OrderLines LineNo="5" Qty="1"/>
</OrderLines>
</Order>
I need to store the OrderLines in a map based on descending value of qty. I was thinking about a TreeMap, but then it expects only unique values for keys. In my case, the Qty can be same for multiple lines.
I am thinking about having the Qty as Key and it may not be unique.
Any help on this anyone?