public final <T extends AstNode> void insertChildBefore(final AstNode nextSibling, final T child, final Role<T> role) { VerifyArgument.notNull(role, "role"); if (nextSibling == null || nextSibling.isNull()) { addChild(child, role); return; } if (child == null || child.isNull()) { return; } verifyNotFrozen(); if (((AstNode)child)._parent != null) { throw new IllegalArgumentException("Node belongs to another tree."); } if (child.isFrozen()) { throw new IllegalArgumentException("Cannot add a frozen node."); } if (nextSibling._parent != this) { throw new IllegalArgumentException("Next sibling is not a child of this node."); } insertChildBeforeUnsafe(nextSibling, child, role); }
public final <T extends AstNode> void insertChildBefore(final AstNode nextSibling, final T child, final Role<T> role) { VerifyArgument.notNull(role, "role"); if (nextSibling == null || nextSibling.isNull()) { addChild(child, role); return; } if (child == null || child.isNull()) { return; } verifyNotFrozen(); if (((AstNode)child)._parent != null) { throw new IllegalArgumentException("Node belongs to another tree."); } if (child.isFrozen()) { throw new IllegalArgumentException("Cannot add a frozen node."); } if (nextSibling._parent != this) { throw new IllegalArgumentException("Next sibling is not a child of this node."); } insertChildBeforeUnsafe(nextSibling, child, role); }
public final <T extends AstNode> void insertChildBefore(final AstNode nextSibling, final T child, final Role<T> role) { VerifyArgument.notNull(role, "role"); if (nextSibling == null || nextSibling.isNull()) { addChild(child, role); return; } if (child == null || child.isNull()) { return; } verifyNotFrozen(); if (((AstNode)child)._parent != null) { throw new IllegalArgumentException("Node belongs to another tree."); } if (child.isFrozen()) { throw new IllegalArgumentException("Cannot add a frozen node."); } if (nextSibling._parent != this) { throw new IllegalArgumentException("Next sibling is not a child of this node."); } insertChildBeforeUnsafe(nextSibling, child, role); }
oldParent.insertChildBeforeUnsafe(oldSuccessor, replacement, oldRole);
oldParent.insertChildBeforeUnsafe(oldSuccessor, replacement, oldRole);
oldParent.insertChildBeforeUnsafe(oldSuccessor, replacement, oldRole);