Remove a single child from this {@link Node}

@return true if this node contained the given child
@throws IllegalArgumentException
if multiple children with name exist.
172451
public Node removeChild(final String name) {
        final Node node = getSingle(name);
        if (node != null) {
            removeChild(node);
        }
        return node;
    }
65525
public boolean removeChild( PlanNode child ) {
        boolean result = this.children.remove(child);
        if (result) {
            child.parent = null;
        }
        return result;
    }
1145305
public static void removeChild(Node parent, Node node) {
    if (isTryFinallyNode(parent, node)) {
      if (NodeUtil.hasCatchHandler(getCatchBlock(parent))) {
        // A finally can only be removed if there is a catch.
        parent.removeChild(node);
      } else {
        // Otherwise, only its children can be removed.
        node.detachChildren();
      }
    } else if (node.isCatch()) {
      // The CATCH can can only be removed if there is a finally clause.
      Node tryNode = node.getGrandparent();
      checkState(NodeUtil.hasFinally(tryNode));
      node.detach();
    } else if (isTryCatchNodeContainer(node)) {
      // The container node itself can't be removed, but the contained CATCH
      // can if there is a 'finally' clause
      Node tryNode = node.getParent();
      checkState(NodeUtil.hasFinally(tryNode));
      node.detachChildren();
    } else if (node.isBlock()) {
      // Simply empty the block.  This maintains source location and
      // "synthetic"-ness.
      node.detachChildren();
    } else if (isStatementBlock(parent)
        || isSwitchCase(node)
        || node.isMemberFunctionDef()) {
      // A statement in a block or a member function can simply be removed
      parent.removeChild(node);
    } else if (isNameDeclaration(parent) || parent.isExprResult()) {
      if (parent.hasMoreThanOneChild()) {
        parent.removeChild(node);
      } else {
        // Remove the node from the parent, so it can be reused.
        parent.removeChild(node);
        // This would leave an empty VAR, remove the VAR itself.
        removeChild(parent.getParent(), parent);
      }
    } else if (parent.isLabel()
        && node == parent.getLastChild()) {
      // Remove the node from the parent, so it can be reused.
      parent.removeChild(node);
      // A LABEL without children can not be referred to, remove it.
      removeChild(parent.getParent(), parent);
    } else if (parent.isVanillaFor()) {
      // Only Token.FOR can have an Token.EMPTY other control structure
      // need something for the condition. Others need to be replaced
      // or the structure removed.
      parent.replaceChild(node, IR.empty());
    } else if (parent.isObjectPattern()) {
      // Remove the name from the object pattern
      parent.removeChild(node);
    } else if (parent.isArrayPattern()) {
      if (node == parent.getLastChild()) {
        parent.removeChild(node);
      } else {
        parent.replaceChild(node, IR.empty());
      }
    } else if (parent.isDestructuringLhs()) {
      // Destructuring is empty so we should remove the node
      parent.removeChild(node);
      if (parent.getParent().hasChildren()) {
        // removing the destructuring could leave an empty variable declaration node, so we would
        // want to remove it from the AST
        removeChild(parent.getParent(), parent);
      }
    } else if (parent.isRest()) {
      // Rest params can only ever have one child node
      parent.detach();
    } else if (parent.isParamList()) {
      parent.removeChild(node);
    } else if (parent.isImport()) {
      // An import node must always have three child nodes. Only the first can be safely removed.
      if (node == parent.getFirstChild()) {
        parent.replaceChild(node, IR.empty());
      } else {
        throw new IllegalStateException("Invalid attempt to remove: " + node + " from " + parent);
      }
    } else {
      throw new IllegalStateException("Invalid attempt to remove node: " + node + " of " + parent);
    }
  }
885342
public void removeChild(final Node child) {
        if (child instanceof Level) {
            levels.remove(child);
            nodes.remove(child);
            child.setParent(null);
        } else if (child instanceof SpecTopic) {
            removeSpecTopic((SpecTopic) child);
        } else if (child instanceof CommonContent) {
            commonContents.remove(child);
            nodes.remove(child);
            child.setParent(null);
        } else {
            nodes.remove(child);
            child.setParent(null);
        }
    }
1225526
final boolean isAnyChildIgnored() {
    if (isAnyChildIgnored == null) {
      isAnyChildIgnored = false;
      for (RecursableDiffEntity entity : childEntities()) {
        if ((entity.isIgnored() && !entity.isContentEmpty()) || entity.isAnyChildIgnored()) {
          isAnyChildIgnored = true;
          break;
        }
      }
    }
    return isAnyChildIgnored;
  }
1040772
public static boolean isLeaf(Node node) {
        return node instanceof Leaf || node.children() == null || node.children().size() == 0;
    }
567592
public void addChild(TreeElement child)
            throws IllegalArgumentException
    {

        TreeElement theChild = child;
        theChild.setParent(this);
        if (getName() == null) {
            setName("0");
        }
        if (_children == null) {
            _children = new ArrayList();
        }
        //int n = _children.size();
        //if (n > 0) {
        //    TreeElement node = (TreeElement) _children.get(n - 1);
        //    node.setLast(false);
        //}
        //theChild.setLast(true);
        _children.add(child);
        int n = _children.size();
        theChild.updateName(this, n - 1);
    }
202832
public final boolean hasChild(Node child) {
    for (Node n = first; n != null; n = n.next) {
      if (child == n) {
        return true;
      }
    }
    return false;
  }
873222
public boolean remove(HtmlObject child) {
		if (child instanceof AbstractHtmlObject) {
			((AbstractHtmlObject) child).setParent(null);
		}
		return asDivPanel().remove(child);
	}
233048
@Override
    public boolean remove(Widget w) {
        // Validate.
        if (w.getParent() != this) {
            return false;
        }
        // Orphan.
        try {
            orphan(w);
        } finally {
            // Physical detach.
            Element elem = w.getElement();
            // NOTE (issue #486): DO NOT call DOM.getParent() to correctly handle
            // text node removing. Calling DOM.getParent(TEXT_NODE) will throw a
            // NPE exception.
            //DOM.getParent(elem).removeChild(elem);
            elem.removeFromParent();

            // Logical detach.
            getChildren().remove(w);
        }
        return true;
    }
36154
public void removeChildren() {
        for (int i = children.size() - 1; i >= 0; i--) {
            removeChild(children.get(i), true);
        }
    }
82397
public boolean removeBusHalt(String name) {
		Iterator<BusItineraryHalt> iterator = this.validHalts.iterator();
		BusItineraryHalt bushalt;
		int i = 0;
		while (iterator.hasNext()) {
			bushalt = iterator.next();
			if (name.equals(bushalt.getName())) {
				return removeBusHalt(i);
			}
			++i;
		}

		iterator = this.invalidHalts.iterator();
		i = 0;
		while (iterator.hasNext()) {
			bushalt = iterator.next();
			if (name.equals(bushalt.getName())) {
				return removeBusHalt(i);
			}
			++i;
		}

		return false;
	}
174476
protected void delete(Node<K, V> n) {
        if (n == root) {
            deleteMin();
            return;
        }

        if (n.y_s == null) {
            throw new IllegalArgumentException("Invalid handle!");
        }

        // disconnect and union children of node
        Node<K, V> childTree = unlinkAndUnionChildren(n);

        // find parent
        Node<K, V> p = getParent(n);

        // link children tree in place of node
        if (childTree == null) {
            // no children, just unlink from parent
            if (p.o_c == n) {
                if (n.y_s == p) {
                    p.o_c = null;
                } else {
                    p.o_c = n.y_s;
                }
            } else {
                p.o_c.y_s = p;
            }
        } else {
            // link children tree to parent
            if (p.o_c == n) {
                childTree.y_s = n.y_s;
                p.o_c = childTree;
            } else {
                p.o_c.y_s = childTree;
                childTree.y_s = p;
            }
        }

        size--;
        n.o_c = null;
        n.y_s = null;
    }
406382
int removeDisposedChildSlot(Slot slot) {
		if (!slot.isReleased() || !subSlots.remove(slot)) {
			throw new IllegalArgumentException();
		}
		return subSlots.size();
	}
1222120
protected NodeData removeChildNode(final String parentIdentifier, final String childIdentifier)
   {
      final List<NodeData> childNodes = nodesCache.get(parentIdentifier);
      if (childNodes != null)
      {
         synchronized (childNodes)
         { // [PN] 17.01.07
            for (Iterator<NodeData> i = childNodes.iterator(); i.hasNext();)
            {
               NodeData cn = i.next();
               if (cn.getIdentifier().equals(childIdentifier))
               {
                  i.remove();
                  return cn;
               }
            }
         }
      }
      return null;
   }
179157
public void removeNode(Node n)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

    this.removeElement(n);
  }
423029
private boolean removeConvertedNodes(AbstractNode node) {
    boolean nodeRemoved = false;
    Iterator<AbstractNode> it = node.getChildren().iterator();
    while (it.hasNext()) {
      FilterJoinNode child = (FilterJoinNode) it.next();
      if (child.getState().equals(FilterJoinNode.State.CONVERTED)) {
        it.remove();
        nodeRemoved |= true;
      }
      else {
        nodeRemoved |= this.removeConvertedNodes(child) ? true : false;
      }
    }
    return nodeRemoved;
  }