****************************************************************************
Performs inheritance of parent attributes/functions to child

@param child The child object
@param parent The parent object
437735
function inherit(child, parent, options) {
  
  if (options && options.deepExtend) {
    
    //copy all members of parents to this (the child)
    deepExtend(child, parent);
  
  } else {
  
    extend(child, parent);
  
  }
  
  //constructor helper
  function ctor() { this.constructor = child; }
  
  //set ctor prototype to the parent's
  ctor.prototype = parent.prototype;
  
  // Put the parent's prototype in the child's prototype hierarchy
  //
  // i.e. set the child's prototype to new object such that
  //
  // (1) child.prototype.constructor = parent.contructor = child
  // (2) child.prototype.__proto__   = parent.__proto__ 
  //                                 = ctor.prototype 
  //                                 = parent.prototype
  //
  child.prototype = extend(new ctor, child.prototype, {overwrite: true});
  
  //save the parent's prototype for future reference
  child.__super__ = parent;
}
154887
public function setChild($parent, $child)
    {
        if (is_string($parent)) {
            $name   = $parent;
            $parent = $this->getItem($parent);
            if (is_null($parent)) {
                throw new Exception("Unknown parent:$name at setChild");
            }
        }
        if (is_string($child)) {
            $name  = $child;
            $child = $this->getItem($child);
            if (is_null($child)) {
                throw new Exception("Unknown child:$name at setChild");
            }
        }
        if (isset($this->children[$parent->name][$child->name])) {
            return false;
        }

        return $this->addChild($parent, $child);
    }
894194
function (Child, Parent) {
    // copy Parent static properties
    for (var key in Parent) {
      // make sure we only copy hasOwnProperty properties vs. prototype
      // properties
      if (_.has(Parent, key))
        Child[key] = Parent[key];
    }

    // a middle member of prototype chain: takes the prototype from the Parent
    var Middle = function () {
      this.constructor = Child;
    };
    Middle.prototype = Parent.prototype;
    Child.prototype = new Middle();
    Child.__super__ = Parent.prototype;
    return Child;
  }
576418
public void init(Object parent, Object objURL)
    {
        super.init(parent, objURL);

        this.setLayout(new BorderLayout());

        String strURL = this.getBaseApplet().getProperty(Params.URL);
        if (strURL != null)
            if (strURL.indexOf(':') != -1)
                strURL = strURL.substring(strURL.indexOf(':') + 1);
        this.displayURL(strURL);
    }
1220913
protected static boolean isChildOf(String parent, String child) {
      if (parent == null || child == null)
         return false;
      if (!child.startsWith((parent.endsWith(SEPARATOR) ? parent : parent + SEPARATOR)))
         return false;
      if (child.length() <= parent.length())
         return false;
      int from = parent.equals(SEPARATOR) ? parent.length() : parent.length() + 1;
      //  if(from-1 > child.length())
      // return false;
      String[] comps = Util.components(child.substring(from), SEPARATOR);
      return comps != null && comps.length <= 1;
   }
555874
public void showParamPanel(String parent, String child) {
        if (parent == null || child == null) {
            return;
        }

        AbstractParamPanel panel = tablePanel.get(parent);
        if (panel == null) {
            return;
        }
        
        showParamPanel(panel, parent);
    }
554388
public void deleteElement(Object parent, String name) {
		Element element = getElement(parent, name);
		if (element != null) {
			Element group = (Element) element.getParentElement();
			if (group != null) {
				deleteRecursively(group, element);
			}
		}
	}
765140
public void addToFirstChildren(XmlElement parent,Element child){
        List<Element> elements = parent.getElements();
        elements.add(0,child);
    }
343445
def delete_child(attribute, instance=nil)
      if self.send(attribute).is_a?(Array)
        deleted = self.send(attribute).delete(instance)
        deleted.parent = nil if deleted
      else
        self.send(attribute).parent = nil if self.send(attribute)
        self.instance_variable_set("@#{attribute}", nil)
      end
    end
1370958
public void add(DepTreeNode child) {
		if (children == null) {
			children = new HashMap<String, DepTreeNode>();
		}
		children.put(child.getName(), child);
		child.setParent(this);
	}
313006
function(Child, Parent) {
    var hasProp = {}.hasOwnProperty;

    function T() {
        this.constructor = Child;
        this.constructor$ = Parent;
        for (var propertyName in Parent.prototype) {
            if (hasProp.call(Parent.prototype, propertyName) &&
                propertyName.charAt(propertyName.length-1) !== "$"
           ) {
                this[propertyName + "$"] = Parent.prototype[propertyName];
            }
        }
    }
    T.prototype = Parent.prototype;
    Child.prototype = new T();
    return Child.prototype;
}
97428
public void setParent(Model parent) {
        if (parent == this) {
            throw new IllegalArgumentException("The model can't be its own parent");
        }
        if (parent == null) {
            this.parent.children.remove(this);
        } else {
            parent.children.add(this);
        }
        this.parent = parent;
    }
185769
function inherit(inheritor, inherited) {
    inheritor.prototype = Object.create(inherited.prototype);
    inheritor.prototype.constructor = inheritor;
  }
1261141
@SuppressWarnings("unchecked")
    public void addChild(final AbstractEdge<?> edge, final AbstractNode child) {
        if (child == null || edge == null ||
                edge.getIntervals() == null || edge.getIntervals().size() == 0) {
            throw new IllegalArgumentException("Cannot add null child or empty edge");
        }

        edge.setSubDiagram(child);
        edges.add((AbstractEdge<T>) edge);
    }
1065923
@Override
  public void applySubclassRelationship(
      final NominalTypeBuilder parent, final NominalTypeBuilder child, SubclassType type) {
    super.applySubclassRelationship(parent, child, type);
    if (type == SubclassType.INHERITS) {
      final FunctionType childCtor = child.constructor();
      child.declareConstructorProperty(
          "superClass_", parent.prototypeOrInstance(), childCtor.getSource());
      // Notice that constructor functions do not need to be covariant on the superclass.
      // So if G extends F, new G() and new F() can accept completely different argument
      // types, but G.prototype.constructor needs to be covariant on F.prototype.constructor.
      // To get around this, we just turn off type-checking on arguments and return types
      // of G.prototype.constructor.
      FunctionType qmarkCtor = childCtor.forgetParameterAndReturnTypes();
      child.declarePrototypeProperty("constructor", qmarkCtor, childCtor.getSource());
    }
  }
853032
@Override
  public void setParent(Logger parent)
  {
    if (parent.equals(_parent))
      return;
    
    super.setParent(parent);

    if (parent instanceof EnvironmentLogger) {
      _parent = (EnvironmentLogger) parent;

      _parent.addChild(this);
    }
    
    updateEffectiveLevel(_systemClassLoader);
  }
681235
public void removeChild(String child)
    {
        final Xml node = getChild(child);
        root.removeChild(node.getElement());
    }