Adds an item or set of items

@param scalar|array
@param scalar|null
@param string|null
@return this
335273
public function setItems($value, $label = null) {
		Argument::i()
			->test(1, 'string', 'array')
			->test(2, 'scalar', 'null')
			->test(3, 'string', 'null');
			
		if(is_array($value)) {
			$this->items = $value;
			return $this;
		}
			
		$this->items[$value] = $label;
		return $this;
	}
610595
function (items) {
        // if Type supports parsing of string headers then do it before adding it.
        _.isString(items) && _.isFunction(this.Type.parse) && (items = this.Type.parse(items));
        // add a single item or an array of items.
        _.forEach(_.isArray(items) ? items :
            // if population is not an array, we send this as single item in an array or send each property separately
            // if the core Type supports Type.create
            ((_.isPlainObject(items) && _.has(this.Type, 'create')) ? items : [items]), this.add.bind(this));
    }
1287113
public void addItem (int index, T item)
    {
        if (_items == null) {
            return;
        }
        _items.add(index, item);
    }
949718
public function add(array $items) {
		
		foreach($items as $name => $object) {
			$this->set($name, $object);
		}
		
		return $this;
	}
1079564
public function addItem($item)
    {
        if (!is_numeric($item)) {
            throw new \InvalidArgumentException(sprintf("Value '%s' must be a numeric value", $item));
        }

        $this->items[] = $item;

        return $this;
    }
867336
@SafeVarargs
    public final ModelAdapter<Model, Item> add(Model... items) {
        return add(asList(items));
    }
705812
def add(self, attr, item):
        
        return self.set(attr, operation.Add([item]))
98496
public int add(T item) {
		if (itemIndex.containsKey(item)) {
			// Items can only be added once
			return itemIndex.get(item);
		}
		int index = items.size();
		itemIndex.put(item, index);
		items.add(item);
		return index;
	}
845925
public static <T> Iterable<PSArray<T>> create(Iterable<T> items, final Comparator<T> comparator) {
        MutableArray<T> initial = MutableArrayFromIterable.create(items);
        GoodSortingAlgorithm.getInstance().sort(initial, comparator);
        return IterableUsingStatusUpdater.create(initial, new Updater<PSArray<T>>() {
            @Override
            public PSArray<T> getUpdatedOrNull(PSArray<T> current) {
                MutableArray<T> next = MutableArrayFromIterable.create(current);
                boolean success = NextPermutation.step(next, comparator);
                return success ? next : null;
            }
        });
    }
1266530
public function addItem($item, $attribs = [])
    {
        if (!$item instanceof ListItem) {
            $item = new ListItem($item, $attribs);
        }

        $this->content[] = $item;

        return $this;
    }
542184
public FacetBuilder setItemsList(Map<String, String> items) {
        ArrayList<FacetWidgetItem> facetWidgetItems = new ArrayList<FacetWidgetItem>();

        for (String key : items.keySet()){
            String label = items.get(key);
            FacetWidgetItem facetWidgetItem = new FacetWidgetItem(key, label);
            facetWidgetItems.add(facetWidgetItem);
        }
        this.listItems = facetWidgetItems;
        return this;
    }
397975
public void add(T item, long delta) {
        MutableLong entry = map.get(item);
        if (entry == null) {
            entry = MutableLong.valueOf(delta);
            map.put(item, entry);
        } else {
            entry.value += delta;
        }
        total += delta;
    }
938432
public synchronized ComboBox<V> addItem(V item) {
        if(item == null) {
            throw new IllegalArgumentException("Cannot add null elements to a ComboBox");
        }
        items.add(item);
        if(selectedIndex == -1 && items.size() == 1) {
            setSelectedIndex(0);
        }
        invalidate();
        return this;
    }
466371
def add(self, item):
        """"""
        if item in self._set:
            self._fifo.remove(item)
        elif len(self._set) == self.max_items:
            self._set.remove(self._fifo.pop(0))
        self._fifo.append(item)
        self._set.add(item)
1031573
public function set($key, $value=null)
    {
        if (is_array($key)) {
            $this->data = array_merge($this->data, $key);
        } elseif ($key instanceof Collection) {
            $this->set($key->all());
        } elseif (is_scalar($key)) {
            $this->data[$key] = $value;
        }
        
        return $this;
    }
677124
public ESigItem add(ESigItem item) {
        if (!items.contains(item)) {
            items.add(item);
            fireEvent("ADD", item);
        }
        
        return item;
    }
1121076
public static function add($key = null, $data = [])
    {
        // If no key is given
        if (is_null($key)) {
            // Set key to file and line
            $key = Debugger::getCalledFrom(2);
        }

        // If key is allready in use
        if (isset(self::$collection[$key])) {
            // Get original item
            $item = self::$collection[$key];

            // Set new item count
            $itemCount = (isset($item['count']) ? ($item['count'] + 1) : 2);

            // Set correct key for the original item
            if (strpos($item['key'], '#') === false) {
                self::$collection[$key] = array_merge($item, [
                    'key'   => $key . ' #1',
                    'count' => $itemCount,
                ]);
            } else {
                self::$collection[$key] = array_merge($item, [
                    'count' => $itemCount,
                ]);
            }

            // Set new key
            $key = $key . ' #' . $itemCount;
        }

        // Make sure various options are set
        if (!isset($data['key'])) {
            $data['key'] = $key;
        }
        if (!isset($data['parent'])) {
            $data['parent'] = self::$currentItem;
        }
        if (!isset($data['level'])) {
            $data['level'] = 0;
            if (isset($data['parent']) && isset(self::$collection[$data['parent']])) {
                $data['level'] = (self::$collection[$data['parent']]['level'] + 1);
            }
        }

        // Add item to collection
        self::$collection[$key] = $data;

        return $key;
    }