Esempio n. 1
0
  void replaceChild(Node oldChild, Node newChild) {
    if (_id_ == oldChild) {
      setId((TId) newChild);
      return;
    }

    if (_arrow_ == oldChild) {
      setArrow((TArrow) newChild);
      return;
    }

    for (ListIterator i = _prodTransform_.listIterator(); i.hasNext(); ) {
      if (i.next() == oldChild) {
        if (newChild != null) {
          i.set(newChild);
          oldChild.parent(null);
          return;
        }

        i.remove();
        oldChild.parent(null);
        return;
      }
    }

    for (ListIterator i = _alts_.listIterator(); i.hasNext(); ) {
      if (i.next() == oldChild) {
        if (newChild != null) {
          i.set(newChild);
          oldChild.parent(null);
          return;
        }

        i.remove();
        oldChild.parent(null);
        return;
      }
    }
  }