/** Adds a child. * * @exception IllegalStateException if this is not an instance of * {@link TemplateInfo} and {@link ShadowInfo}. */ public void appendChild(NodeInfo child) { if (!((child instanceof ShadowInfo) || (child instanceof TemplateInfo))) throw new IllegalStateException("Only accept template and shadow element to be a child of " + this); super.appendChild(child); }
public boolean removeChild(NodeInfo child) { if (child != null && _children.remove(child)) { ((LeafInfo) child).setParentDirectly(null); //except root, all are LeafInfo fixEvaluatorRefDown(child, null); return true; } return false; }
public boolean removeChild(NodeInfo child) { if (child != null && _children.remove(child)) { ((LeafInfo) child).setParentDirectly(null); //except root, all are LeafInfo BranchInfo.fixEvaluatorRefDown(child, null); return true; } return false; }
/*package*/ static final void fixEvaluatorRefDown(NodeInfo child, EvaluatorRef evalr) { if (child instanceof LeafInfo) ((LeafInfo) child)._evalr = evalr; final List<NodeInfo> children = child.getChildren(); if (children != null) //it is null if this method is called in constructor for (NodeInfo c : children) fixEvaluatorRefDown(c, evalr); }
public void appendChild(NodeInfo child) { NodeInfo oldp = child.getParent(); if (oldp != null) oldp.removeChild(child); _children.add(child); ((LeafInfo) child).setParentDirectly(this); //except root, all are LeafInfo fixEvaluatorRefDown(child, _evalr); }
public void appendChild(NodeInfo child) { NodeInfo oldp = child.getParent(); if (oldp != null) oldp.removeChild(child); _children.add(child); ((LeafInfo) child).setParentDirectly(this); //except root, all are LeafInfo BranchInfo.fixEvaluatorRefDown(child, getEvaluatorRef()); //Use getEvaluatorRef() to force _evalr being assigned }