Android: Create List<Map<String, List<ObjectType>>
<p>Can someone help me solve my problem, how to create <code>List&lt;Map&lt;Integer, List&lt;MyType&gt;&gt;</code> in while cycle. I'm slecting data from database and I'd like to add objects, that accomplish select's where condition into List and then put it into <code>Map&lt;Integer, List&lt;MyType&gt;</code> where map key is in my case integer from database column order_num. Finally I wuold like to add all created maps into List. Method's return value is <code>List&lt;Map&lt;Integer, List&lt;MyType&gt;&gt;&gt;</code>.</p>

<p>Here's my part of source:</p>

<pre><code>while (cursor.moveToNext) {
       int id = cursor.getInt(cursor.getColumnIndex("item_id"));
       int orderNum = cursor.getInt(cursor.getColumnIndex("order_num"));
       String name = cursor.getString(cursor.getColumnIndex("item_name"));

       list.add(new Item(id, orderNum, name);
   }
</code></pre>

<p>now I'd like to add this list into Map where key is <code>orderNum</code> and value is <code>List&lt;Item&gt;</code>.</p>
