// // 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; }
TreeNode findChildLike(TreeNode other) { // // Default implementation just use id; not always appropriate // return (TreeNode) findChild(other.getId()); }