/** * Tries to find the child with the given name. * Returns <code>null</code> if no such child exists. * * @param name of the child to find * @return the first element with a matching name */ public IDiffElement findChild(String name) { Object[] children= getChildren(); for (int i= 0; i < children.length; i++) { IDiffElement child= (IDiffElement) children[i]; if (name.equals(child.getName())) return child; } return null; }
public void removeToRoot(IDiffElement child) { if (fChildren != null) { fChildren.remove(child); child.setParent(null); if (fChildren.size() == 0) { IDiffContainer p= getParent(); if (p != null) p.removeToRoot(this); } } }
@Override public void removeToRoot(IDiffElement child) { if (fChildren != null) { fChildren.remove(child); child.setParent(null); if (fChildren.isEmpty()) { IDiffContainer p= getParent(); if (p != null) p.removeToRoot(this); } } }
/** * Tries to find the child with the given name. * Returns <code>null</code> if no such child exists. * * @param name of the child to find * @return the first element with a matching name */ public IDiffElement findChild(String name) { Object[] children= getChildren(); for (int i= 0; i < children.length; i++) { IDiffElement child= (IDiffElement) children[i]; if (name.equals(child.getName())) return child; } return null; }