This method adds the container if no such rule container exists in this lookup and returns the index otherwise.
482753
private int addRuleContainer(SpatialRuleContainer container) {
        int newIndex = this.ruleContainers.indexOf(container);
        if (newIndex >= 0)
            return newIndex;

        newIndex = ruleContainers.size();
        if (newIndex >= 255)
            throw new IllegalStateException("No more spatial rule container fit into this lookup as 255 combination of ruleContainers reached");

        this.ruleContainers.add(container);
        return newIndex;
    }
1060289
private ContainerCreateConfig add(String name, String value) {
        if (value != null) {
            createConfig.addProperty(name, value);
        }
        return this;
    }
1372516
@Override
  public Container add(final short x) {
    if (cardinality == 0 || (cardinality > 0
            && toIntUnsigned(x) > toIntUnsigned(content[cardinality - 1]))) {
      if (cardinality >= DEFAULT_MAX_SIZE) {
        return toBitmapContainer().add(x);
      }
      if (cardinality >= this.content.length) {
        increaseCapacity();
      }
      content[cardinality++] = x;
    } else {
      int loc = Util.unsignedBinarySearch(content, 0, cardinality, x);
      if (loc < 0) {
        // Transform the ArrayContainer to a BitmapContainer
        // when cardinality = DEFAULT_MAX_SIZE
        if (cardinality >= DEFAULT_MAX_SIZE) {
          return toBitmapContainer().add(x);
        }
        if (cardinality >= this.content.length) {
          increaseCapacity();
        }
        // insertion : shift the elements > x by one position to
        // the right
        // and put x in it's appropriate place
        System.arraycopy(content, -loc - 1, content, -loc, cardinality + loc + 1);
        content[-loc - 1] = x;
        ++cardinality;
      }
    }
    return this;
  }
236722
@Override
	public boolean add(int o) {
		// Shortcut for empty
		int mySize=size();
		if(mySize==0) {
			super.add(o);
		} else {
			// Shortcut for adding to end (makes imports of already-sorted data operate at constant-time instead of logarithmic complexity)
			if(o>=elementData[mySize-1]) {
				super.add(o);
			} else {
				int index=binarySearch(o);
				if(index<0) {
					// Not found in list
					super.add(-(index+1), o);
				} else {
					// Add after existing
					super.add(index+1, o);
				}
			}
		}

		return true;
	}
147898
public Container or(Container x) {
    if (x instanceof ArrayContainer) {
      return or((ArrayContainer) x);
    } else if (x instanceof BitmapContainer) {
      return or((BitmapContainer) x);
    }
    return or((RunContainer) x);
  }
1349728
def store_container(self, container):
    
    with self._store_lock:
      self.store.setdefault(container.CONTAINER_TYPE, []).append(container)
313991
def container(self):
        
        if self.parent is None:
            return None
        elif self.location is None:
            return self.parent.content
        else:
            container = getattr(self.parent, self.location)
            if isinstance(container, (ListContainer, DictContainer)):
                return container
            else:
                assert self is container
81658
public static IndexedContainer buildContainerFromMap(String captionProperty, Map<String, String> map) {

        IndexedContainer container = new IndexedContainer();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            container.addItem(entry.getKey()).getItemProperty(captionProperty).setValue(entry.getValue());
        }
        return container;
    }
1176451
public static IndexedContainer getResourceTypesContainer() {

        IndexedContainer types = new IndexedContainer();
        types.addContainerProperty(PropertyId.caption, String.class, null);
        types.addContainerProperty(PropertyId.icon, Resource.class, null);
        types.addContainerProperty(PropertyId.isFolder, Boolean.class, null);
        types.addContainerProperty(PropertyId.isXmlContent, Boolean.class, null);
        for (I_CmsResourceType type : getResourceTypes()) {
            CmsExplorerTypeSettings typeSetting = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                type.getTypeName());
            Item typeItem = types.addItem(type);
            typeItem.getItemProperty(PropertyId.caption).setValue(CmsVaadinUtils.getMessageText(typeSetting.getKey()));
            typeItem.getItemProperty(PropertyId.icon).setValue(CmsResourceUtil.getSmallIconResource(typeSetting, null));
            typeItem.getItemProperty(PropertyId.isXmlContent).setValue(
                Boolean.valueOf(type instanceof CmsResourceTypeXmlContent));
            typeItem.getItemProperty(PropertyId.isFolder).setValue(
                Boolean.valueOf(type instanceof A_CmsResourceTypeFolderBase));
        }

        return types;
    }
21883
function (container) {
                if (container[parProp]) {
                    // back references already present, nothing to do
                    return;
                }
                // back references are not present yet
                container[parProp] = [];
                for (var childName in container) {
                    if (container.hasOwnProperty(childName) && __includePropForBackRef(childName)) {
                        var childValue = container[childName];
                        if (__isValidContainer(childValue)) {
                            this.__checkBackRefs(childValue);
                            // Add the container reference and property name to the child 'aria:parent' array
                            childValue[parProp].push({
                                parent : container,
                                property : childName
                            });
                            this.$raiseEvent({
                                name : 'aria-parent-metadata-added',
                                child: childValue,
                                parent: container,
                                property: childName
                            });
                        }
                    }
                }
            }
965055
def ensure_container(self, name=None):
        """"""
        if get_lxc_version() < pkg_resources.parse_version('2.0.0'):
            # Nothing to do for old versions of LXC
            return

        if name is None:
            name = self.container_name

        args = [
            'lxc-create',
            '--name', name,
            '--template', 'none',
            '>', '/dev/null', '2>&1',
        ]
        os.system(' '.join(args))
1276278
def enterContainer(self, entry, query):
        
        self._compoundStack.append(entry)
        self.addContainer(query)
715195
def add_after(self):
        """"""
        idx = self._container.structure.index(self)
        return BlockBuilder(self._container, idx+1)
1241889
public DockerRuleBuilder keepContainer(boolean keepContainer) {
        if (keepContainer) {
            this.stopOptions.setOptions(StopOption.KEEP);
        } else {
            this.stopOptions.setOptions(StopOption.REMOVE);
        }
        return this;
    }
335038
def _add_to_dict(t, container, name, value):
    

    if name in container:
        raise Exception("%s '%s' already exists" % (t, name))
    else:
        container[name] = value
1012566
public StructuredQueryDefinition containerQuery(ContainerIndex index, StructuredQueryDefinition query) {
    checkQuery(query);
    return new ContainerQuery(index, query);
  }
942475
def _add_to_index(index, obj):
    """"""
    id_set = index.value_map.setdefault(indexed_value(index, obj), set())
    if index.unique:
        if len(id_set) > 0:
            raise UniqueConstraintError()
    id_set.add(obj.id)