/** search descendant recursive to find the first specified ASTNode */ public IASTNode getDescendant(int id, String name) { IASTNode ret = null; for (int i = 0; i < children.size(); i++) { ASTNode child = (ASTNode) children.get(i); if (child.getId() == id && name.equalsIgnoreCase(child.getName())) { ret = child; break; } ret = child.getDescendant(id, name); if (ret != null) { break; } } return ret; }