Puts a new reference into this reference map.

        :param locator: a component reference to be added.

        :param component: a locator to find the reference by.
195348
def put(self, locator = None, component = None):
        
        if component == None:
            raise Exception("Component cannot be null")

        self._lock.acquire()
        try:
            self._references.append(Reference(locator, component))
        finally:
            self._lock.release()
507899
protected void storeReference(int refId, Object newRef) {
        refMap.put(Integer.valueOf(refId), newRef);
    }
1233155
function(component, ref, owner) {
    ("production" !== "development" ? invariant(
      ReactOwner.isValidOwner(owner),
      'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' +
      'usually means that you\'re trying to add a ref to a component that ' +
      'doesn\'t have an owner (that is, was not created inside of another ' +
      'component\'s `render` method). Try rendering this component inside of ' +
      'a new top-level component which will hold the ref.'
    ) : invariant(ReactOwner.isValidOwner(owner)));
    owner.attachRef(ref, component);
  }
1027474
def register_reference(self, dispatcher, node):
        

        # the identifier node itself will be mapped to the current scope
        # for the resolve to work
        # This should probably WARN about the node object being already
        # assigned to an existing scope that isn't current_scope.
        self.identifiers[node] = self.current_scope
        self.current_scope.reference(node.value)
537314
public final void addComponent(ComponentRenderer component)
    {
        renderers.add(component);
        services.add(component);
        if (component instanceof HandlerListener)
        {
            addListener((HandlerListener) component);
        }
    }
1043437
def add(self, child):
        

        if isinstance(child, Component):
            self.add_child(child)
        else:
            raise ModelError('Unsupported child element')
21614
def add_component_definition(self, definition):
        
        # definition.identity = self._to_uri_from_namespace(definition.identity)
        if definition.identity not in self._components.keys():
            self._components[definition.identity] = definition
        else:
            raise ValueError("{} has already been defined".format(definition.identity))
439474
def add_reference(self, reftype: str, label: str, target):
        

        # The self.data[reftype] dict springs into being during the
        # register_references event handler at startup, which looks in the
        # kb registry for all registered reference names.
        self.data[reftype][label] = target
540899
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
        final Reference ref = new Reference();
        ref.setSource(referenceSource);
        ref.setName(referenceName);
        ref.setUrl(referenceUrl);
        this.references.add(ref);
    }
403076
def add_ref(self, ref):
        

        self.refs[ref.insn_addr].append(ref)
        self.data_addr_to_ref[ref.memory_data.addr].append(ref)
532592
public static Attributes addLocationAttributes(Locator locator, Attributes attrs) {
		if (locator == null || attrs.getIndex(URI, SRC_ATTR) != -1) {
			return attrs;
		}
		AttributesImpl newAttrs = attrs instanceof AttributesImpl ? (AttributesImpl) attrs : new AttributesImpl(attrs);
		
		return newAttrs;
	}
248090
private void addComponent(final WComponent component) {
		collapsibleList.add(component);
		MemoryUtil.checkSize(collapsibleList.size(), this.getClass().getSimpleName());
	}
217414
function findRefObject (ref, components) {
  const [ typeAndName, jsonSelector ] = typeNamePath(ref)

  const [ , refObj ] = findComponent(
    typeAndName,
    components,
    jsonSelector
  )

  if (!refObj) {
    return findRefObjectsByWildcard(typeAndName, components)
  }

  return refObj
}
736881
function byIdRef(id, ref) {
      var cmp = this.byId(id).lookupReferenceHolder(false).lookupReference(ref);
      if (!cmp) {
        throw new Error('Component not found for container id: ' + id + ', reference: ' + ref);
      }
      return cmp;
    }
374080
def insertComponent(self, index, comp):
        """"""
        # new component needs to be wrapped
        if self.columnCountForRow(index.row()) == 0:
            self.beginInsertRows(QtCore.QModelIndex(), index.row(), index.row())
            self._stim.insertComponent(comp, index.row(), index.column())
            self.endInsertRows()
        else:
            self._stim.insertComponent(comp, index.row(), index.column())

        self.samplerateChanged.emit(self._stim.samplerate())
1033000
def remove_all(self, locator):
        
        components = []

        if locator == None:
            return components

        self._lock.acquire()
        try:
            for reference in reversed(self._references):
                if reference.match(locator):
                    self._references.remove(reference)
                    components.append(reference.get_component())
        finally:
            self._lock.release()
        
        return components
559926
function addComponent(Component, options) {
                var name = options.name,
                    container = options.container;

                if (name === undefined) {
                    throw 'you have to define data.name for component.';
                } else if (container === undefined) {
                    throw 'You have to define container for component.';
                } else if (this.children[name] !== undefined) {
                    throw 'Component using name:' + name + '! already defined.';
                }
                var component = this.setComponent(Component, options),
                    instance = component.run(options.container);
                instance.setContext(this.context);
                this.children[name] = instance;
                return instance;
            }