Set the right child of this node.

@param newChild is the new left child
@return <code>true</code> on success, otherwise <code>false</code>
11227
public boolean setRightChild(N newChild) {
		final N oldChild = this.right;
		if (oldChild == newChild) {
			return false;
		}

		if (oldChild != null) {
			oldChild.setParentNodeReference(null, true);
			--this.notNullChildCount;
			firePropertyChildRemoved(1, oldChild);
		}

		if (newChild != null) {
			final N oldParent = newChild.getParentNode();
			if (oldParent != this) {
				newChild.removeFromParent();
			}
		}

		this.right = newChild;

		if (newChild != null) {
			newChild.setParentNodeReference(toN(), true);
			++this.notNullChildCount;
			firePropertyChildAdded(1, newChild);
		}

		return true;
	}
1346102
private void setMaxMin(IntervalRBTreeNode<T> n) {
    n.min = n.left;
    n.max = n.right;
    if (n.leftChild != null) {
      n.min = Math.min(n.min, n.leftChild.min);
      n.max = Math.max(n.max, n.leftChild.max);
    }
    if (n.rightChild != null) {
      n.min = Math.min(n.min, n.rightChild.min);
      n.max = Math.max(n.max, n.rightChild.max);
    }
  }
71667
public Node<T> addChild(Node<T> child) {
        if (children == null) {
            children = new ArrayList<Node<T>>();
        }
        child.parent = this;
        children.add(child);

        return child;
    }
908832
private void swap(Node n, Node root) {
        // assert this.root == root;

        Node nLeftChild = n.o_c;
        if (root.o_c == n) {
            if (n.y_s == root) {
                // n is left child and no right sibling
                n.o_c = root;
                root.y_s = n;
            } else {
                // n is left child and has right sibling
                root.y_s = n.y_s;
                root.y_s.y_s = n;
                n.o_c = root;
            }
        } else {
            // n is right child
            root.o_c.y_s = root;
            n.o_c = root.o_c;
            root.y_s = n;
        }
        n.y_s = null;

        // hang children
        root.o_c = nLeftChild;
        if (nLeftChild != null) {
            if (nLeftChild.y_s == n) {
                nLeftChild.y_s = root;
            } else {
                nLeftChild.y_s.y_s = root;
            }
        }
        this.root = n;
    }
656691
public ElemTemplateElement appendChild(ElemTemplateElement newChild)
  {

    error(XSLTErrorResources.ER_CANNOT_ADD,
          new Object[]{ newChild.getNodeName(),
                        this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +

    //" to " + this.m_elemName);
    return null;
  }
178164
@Nullable
  public final Node removeFirstChild() {
    Node child = first;
    if (child != null) {
      removeChild(child);
    }
    return child;
  }
419608
public final void replaceFirstOrChildAfter(@Nullable Node prev, Node newChild) {
    Node target = prev == null ? first : prev.next;
    checkNotNull(target, "prev doesn't have a sibling to replace.");
    replaceChild(target, newChild);
  }
65525
public boolean removeChild( PlanNode child ) {
        boolean result = this.children.remove(child);
        if (result) {
            child.parent = null;
        }
        return result;
    }
1307347
@Override
	public boolean setChildAt(int index, N newChild) throws IndexOutOfBoundsException {
		final N oldChild = (index < this.children.length) ? this.children[index] : null;
		if (oldChild == newChild) {
			return false;
		}

		if (oldChild != null) {
			oldChild.setParentNodeReference(null, true);
			--this.notNullChildCount;
			firePropertyChildRemoved(index, oldChild);
		}

		if (newChild != null) {
			final N oldParent = newChild.getParentNode();
			if (oldParent != this) {
				newChild.removeFromParent();
			}
		}

		// set the element
		this.children[index] = newChild;

		if (newChild != null) {
			newChild.setParentNodeReference(toN(), true);
			++this.notNullChildCount;
			firePropertyChildAdded(index, newChild);
		}

		return true;
	}
935165
protected boolean firstChild(final Parse child, final Parse parent) {
    return ShiftReduceParser.collapsePunctuation(parent.getChildren(),
        this.punctSet)[0] == child;
  }
1244201
protected void addChild(LazyNode token){
		// If no children have been added yet, lastChild will be null
		if(lastChild==null){
			child=token;
			lastChild=token;
			return;
		}
		// Set the next pointer on the current end of the child list and set last child to the given token
		lastChild.next=token;
		lastChild=token;
	}
1131883
public boolean setChildAt(QuadTreeZone zone, N newChild) {
		switch (zone) {
		case NORTH_WEST:
			return setFirstChild(newChild);
		case NORTH_EAST:
			return setSecondChild(newChild);
		case SOUTH_WEST:
			return setThirdChild(newChild);
		case SOUTH_EAST:
			return setFourthChild(newChild);
		default:
		}
		return false;
	}
1075839
@SuppressWarnings("checkstyle:magicnumber")
	private boolean setChild7(N newChild) {
		if (this.child7 == newChild) {
			return false;
		}

		if (this.child7 != null) {
			this.child7.setParentNodeReference(null, true);
			--this.notNullChildCount;
			firePropertyChildRemoved(6, this.child7);
		}

		if (newChild != null) {
			final N oldParent = newChild.getParentNode();
			if (oldParent != this) {
				newChild.removeFromParent();
			}
		}

		this.child7 = newChild;

		if (newChild != null) {
			newChild.setParentNodeReference(toN(), true);
			++this.notNullChildCount;
			firePropertyChildAdded(6, newChild);
		}

		return true;

	}
1162868
public Node firstChild() {

		if (currentNode == null)
			return null;

		Node node = getFirstChild(currentNode);

		if (node != null)
			currentNode = node;

		return node;
	}
954482
public static boolean hasChildsOf(final Element parentElement, XsdElementEnum child) {
        NodeList nodeList = parentElement.getChildNodes();
        for (int i = 0; i < nodeList.getLength(); i++) {
            final Node childNode = nodeList.item(i);
            if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                final Element childElement = (Element) childNode;
                if (child.isTagNameEqual(childElement.getTagName())) {
                    return true;
                }

                if (childElement.hasChildNodes()) {
                    if (hasChildsOf(childElement, child)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
1188689
public boolean setSecondChild(N newChild) {
		final N oldChild = this.nNorthEast;
		if (oldChild == newChild) {
			return false;
		}

		if (oldChild != null) {
			oldChild.setParentNodeReference(null, true);
			--this.notNullChildCount;
			firePropertyChildRemoved(1, oldChild);
		}

		if (newChild != null) {
			final N oldParent = newChild.getParentNode();
			if (oldParent != this) {
				newChild.removeFromParent();
			}
		}

		this.nNorthEast = newChild;

		if (newChild != null) {
			newChild.setParentNodeReference(toN(), true);
			++this.notNullChildCount;
			firePropertyChildAdded(1, newChild);
		}

		return true;
	}
233239
void setChild(int index, Node child){
        if ((this.splitTest.maxBranches() >= 0)
                && (index >= this.splitTest.maxBranches())) {
            throw new IndexOutOfBoundsException();
        }
        this.children.set(index, child);
	}