/** * Implements IterationStrategyNode */ @Override public final synchronized void setParent(MutableTreeNode newParent) { if (newParent != null && !(newParent instanceof IterationStrategyNode)) throw new IllegalArgumentException( "Parent not a IterationStrategyNode instance: " + newParent); if (newParent != null && !newParent.getAllowsChildren()) throw new IllegalStateException( "New parent does not allow children"); if (newParent == this) throw new IllegalArgumentException("Can't be it's own parent"); removeFromParent(); parent = (IterationStrategyNode) newParent; if (parent != null && !parent.getChildren().contains(this)) parent.insert(this); }