Java - Select object by int
<p>How do I select an object by the an int inside it?</p>

<p>Here is code:</p>

<pre><code>String FolderName = result.getString ("name");
String FolderId = result.getString ("category_id");
String ParentId = result.getString ("parent_id");
int intFolderId = Integer.parseInt(FolderId);
int intParentId = Integer.parseInt(ParentId);
System.out.println( FolderId+" "+FolderName+" "+ParentId );

Map&lt;Integer, Folder&gt; data = new HashMap&lt;Integer, Folder&gt;();
Folder newFolder = new Folder(FolderName, intFolderId, intParentId);
data.put(newFolder.getId(), newFolder);

  for(Folder folder : data.values()) 
  {
    int parentId = folder.getParentFolderId();
    Folder parentFolder = data.get(parentId);
    if(parentFolder != null)
      parentFolder.addChildFolder(folder);
  }
</code></pre>

<p>How can I select an object with a <code>parentID</code> of <code>0</code> for example?</p>
