Пример #1
0
 //
 // Find child whose descriptor == the given descriptor
 //
 TreeNode findChildWithDescriptor(Object descriptor) {
   Enumeration p = children();
   while (p.hasMoreElements()) {
     TreeNode node = (TreeNode) p.nextElement();
     if (node.getDescriptor() == descriptor) {
       return node;
     }
   }
   return null;
 }
Пример #2
0
 TreeNode findChildLike(TreeNode other) {
   //
   // Default implementation just use id; not always appropriate
   //
   return (TreeNode) findChild(other.getId());
 }