Retrieves and sets the parents of the provided children.
@param childMap the map of parent geonameID to the set of children that belong to it
@throws IOException if an error occurs during parent resolution
559065
private void resolveParents(final Map<Integer, Set<GeoName>> childMap) throws IOException {
        Map<Integer, GeoName> parentMap = new HashMap<Integer, GeoName>();
        Map<Integer, Set<GeoName>> grandParentMap = new HashMap<Integer, Set<GeoName>>();
        for (Integer parentId : childMap.keySet()) {
            // Lucene query used to look for exact match on the "geonameID" field
            Query q = NumericRangeQuery.newIntRange(GEONAME_ID.key(), parentId, parentId, true, true);
            TopDocs results = indexSearcher.search(q, null, 1, POPULATION_SORT);
            if (results.scoreDocs.length > 0) {
                Document doc = indexSearcher.doc(results.scoreDocs[0].doc);
                GeoName parent = BasicGeoName.parseFromGeoNamesRecord(doc.get(GEONAME.key()), doc.get(PREFERRED_NAME.key()));
                parentMap.put(parent.getGeonameID(), parent);
                if (!parent.isAncestryResolved()) {
                    Integer grandParentId = PARENT_ID.getValue(doc);
                    if (grandParentId != null) {
                        Set<GeoName> geos = grandParentMap.get(grandParentId);
                        if (geos == null) {
                            geos = new HashSet<GeoName>();
                            grandParentMap.put(grandParentId, geos);
                        }
                        geos.add(parent);
                    }
                }
            } else {
                LOG.error("Unable to find parent GeoName [{}]", parentId);
            }
        }

        // find all parents of the parents
        if (!grandParentMap.isEmpty()) {
            resolveParents(grandParentMap);
        }

        // set parents of children
        for (Integer parentId : childMap.keySet()) {
            GeoName parent = parentMap.get(parentId);
            if (parent == null) {
                LOG.info("Unable to find parent with ID [{}]", parentId);
                continue;
            }
            for (GeoName child : childMap.get(parentId)) {
                child.setParent(parent);
            }
        }
    }
200395
public void setChildren(com.google.api.ads.admanager.axis.v201811.CustomCriteriaNode[] children) {
        this.children = children;
    }
357252
protected List<F> getChildFiles(List<String> childNames) throws IOException {
        if (childNames == null) {
            return null;
        }
        List<F> childFiles = new ArrayList<F>(childNames.size());
        for (String childName : childNames) {
            childFiles.add(getChildFile(childName));
        }
        return childFiles;
    }
32614
function (idMap) {
                if (this.idMap == idMap) {
                    // already the same id map (especially useful if both are null)
                    return;
                }
                // set child idMap to its parent value
                this.idMap = idMap;
                var id = this.id;
                if (id && idMap) {
                    if (idMap[id]) {
                        this.$logError(this.SECTION_ALREADY_EXISTS, [this.tplCtxt.tplClasspath, id]);
                    } else {
                        idMap[id] = this;
                    }
                }
                var content = this._content;
                var contentSize = content.length;
                // add the ids found in this section to the parent map:
                // and recursively call __updateIdMap
                for (var i = 0; i < contentSize; i++) {
                    var elt = content[i];
                    if (elt._type == TYPE_SECTION) {
                        elt.__updateIdMap(idMap);
                    } else {
                        id = elt.id;
                        if (id && idMap) {
                            if (idMap[id]) {
                                this.$logError(this.WIDGET_ID_NOT_UNIQUE, [this.tplCtxt.tplClasspath, id,
                                        elt.behavior.$class]);
                            } else {
                                idMap[id] = elt;
                            }
                        }
                    }
                }
            }
642213
public void setAndLinkChild(int index, AbstractPlanNode child) {
        assert(child != null);
        m_children.set(index, child);
        child.m_parents.add(this);
    }
1248104
@SuppressWarnings({"unchecked", "rawtypes"})
    private void populateMap(Map map, Node node) {
        Map.Entry entry = getMapEntry(node);
        if (entry != null) {
            map.put(entry.getKey(), entry.getValue());
        }
    }
129221
public function load(LoadingContext $context, ParentChildMap $map)
    {
        if (!$map->getItems()) {
            return;
        }
        
        $select = $this->getRelationSelectFromParentRows($map, $parentIdColumnName);

        $this->loadFromSelect($context, $map, $select, $select->getTableAlias(), $parentIdColumnName);
    }
914984
private void addXMLAttributes(Map<String, String> attrMap) {
        if (m_children != null) {
            for (UNode childNode : m_children) {
                // A child node must not contain a tag name to be considered an attribute.
                if (childNode.m_type == NodeType.VALUE && childNode.m_bAttribute && Utils.isEmpty(childNode.m_tagName)) {
                    assert m_name != null && m_name.length() > 0;
                    attrMap.put(childNode.m_name, childNode.m_value);
                }
            }
        }
    }
302691
public void addChild(CmsGalleryTreeEntry child) {

        if (m_children == null) {
            m_children = new ArrayList<CmsGalleryTreeEntry>();
        }
        m_children.add(child);
        child.setParent(this);
    }
82246
func (g *Container) ChildrenMap() (map[string]*Container, error) {
	if mmap, ok := g.Data().(map[string]interface{}); ok {
		children := map[string]*Container{}
		for name, obj := range mmap {
			children[name] = &Container{obj}
		}
		return children, nil
	}
	return nil, ErrNotObj
}
598167
public void replaceMapChildren(Map<String, String> map, String parentId) {
		ArrayList<StringEntity> entities = new ArrayList<>();
		for (String key : map.keySet()) {
			StringEntity entity = new StringEntity();
			entity.setParentId(parentId);
			entity.setId(key);
			entity.setValue(map.get(key));
			entities.add(entity);
		}
		replaceChildren(entities, parentId);
	}
1032813
public void setChild(int idx, int alphabetSize, Node<I> child) {
        if (children == null) {
            children = new ResizingArrayStorage<>(Node.class, alphabetSize);
        }
        children.array[idx] = child;
    }
643122
private void checkUnmappedElements(List<T> offspring,
                                       Map<T, T> mapping,
                                       int mappingStart,
                                       int mappingEnd)
    {
        for (int i = 0; i < offspring.size(); i++)
        {
            if (!isInsideMappedRegion(i, mappingStart, mappingEnd))
            {
                T mapped = offspring.get(i);
                while (mapping.containsKey(mapped))
                {
                    mapped = mapping.get(mapped);
                }
                offspring.set(i, mapped);
            }
        }
    }
1009676
protected function insertRelated(PersistenceContext $context, ParentChildMap $map)
    {
        /** @var Row[] $parents */
        $parents = [];
        /** @var array $children */
        $children = [];

        foreach ($map->getItems() as $key => $item) {
            $parents[$key]  = $item->getParent();
            $children[$key] = $item->getChild();
        }

        $primaryKey = $this->mapper->getPrimaryTable()->getPrimaryKeyColumnName();
        $rows       = $this->reference->syncRelated($context, [], $children);

        foreach ($rows as $key => $row) {
            $parent = $parents[$key];

            if ($row->hasColumn($primaryKey)) {
                $this->setForeignKey([$parent], $this->foreignKeyToRelated, $row->getColumn($primaryKey));
            } else {
                $row->onInsertPrimaryKey(function ($id) use ($parent) {
                    $this->setForeignKey([$parent], $this->foreignKeyToRelated, $id);
                });
            }
        }
    }
610340
@Override
    public Set<IGroupMember> getChildren() throws GroupsException {

        final EntityIdentifier cacheKey = getUnderlyingEntityIdentifier();
        Element element = childrenCache.get(cacheKey);

        if (element == null) {
            final Set<IGroupMember> children = buildChildrenSet();
            element = new Element(cacheKey, children);
            childrenCache.put(element);
        }

        @SuppressWarnings("unchecked")
        final Set<IGroupMember> rslt = (Set<IGroupMember>) element.getObjectValue();
        return rslt;
    }
33870
public final void readChildren(ObjectInputStream in) throws IOException, ClassNotFoundException {
        int childCount = in.readInt();
        for (int i = 0; i < childCount; i++) {
            internalAdd(in.readObject(), false);
        }
    }
412339
public void setChildChannelOptions(final Map<ChannelOption, Object> channelOptions) {
        this.childChannelOptions = channelOptions == null ? Collections.<ChannelOption, Object> emptyMap()
            : channelOptions;
    }