Add item to this collection.

var a = [1,2]
a.add 3
assert a.has(3)  == true
assert a.has(10) == false

Ensure col.has(item)

Property definitions

core $ SimpleCollection :: add
	# Add `item` to this collection.
	#
	#     var a = [1,2]
	#     a.add 3
	#     assert a.has(3)  == true
	#     assert a.has(10) == false
	#
	# Ensure col.has(item)
	fun add(item: E) is abstract
lib/core/collection/abstract_collection.nit:427,2--435,29

neo4j $ NeoNodeCollection :: add
	# Add the specified node to the graph assuming that its local ID is already set.
	#
	# SEE: `create_node`
	# SEE: `register`
	redef fun add(node) is abstract
lib/neo4j/graph/graph.nit:104,2--108,32

core $ ProxyQueue :: add
	redef fun add(e) do seq.add(e)
lib/core/queue.nit:143,2--31

core $ RandQueue :: add
	redef fun add(e)
	do
		seq.add(e)
		# Reset the cache to give the new element a chance!
		peek_cached = false
	end
lib/core/queue.nit:180,2--185,4

core $ MinHeap :: add
	redef fun add(e)
	do
		#assert assert_best else print "try to add {e}"
		#var ol = length
		var ei = items.length + 1
		while ei > 1 do
			var pi = ei/2
			var p = items[pi-1]
			if comparator.compare(p, e) <= 0 then break

			# bubble-up
			items[ei-1] = p

			# next
			ei = pi
		end
		items[ei-1] = e
		#assert length == ol + 1
		#assert assert_best else print "added {e}"
	end
lib/core/queue.nit:244,2--263,4

core $ Sequence :: add
	# A synonym of `push`
	redef fun add(e) do push(e)
lib/core/collection/abstract_collection.nit:1109,2--1110,28

core $ DisjointSet :: add
	# Add a new element in the structure.
	# Initially it is in its own disjoint subset
	#
	# ENSURE: `has(e)`
	redef fun add(e) do
		if nodes.has_key(e) then return
		var ne = new DisjointSetNode
		nodes[e] = ne
		number_of_subsets += 1
	end
lib/core/collection/union_find.nit:125,2--134,4

geometry $ QuadTree :: add
	# Add `item` to the tree, create children if `item_limit` is reached
	redef fun add(item) do if self.is_leaf then self.data.add(item) else add_to_children(item)
lib/geometry/quadtree.nit:69,2--70,91

neo4j $ SequentialNodeCollection :: add
	redef fun add(node) do
		var id = node[id_property]
		assert id isa Int else
			sys.stderr.write "The local ID must be an `Int`.\n"
		end
		assert id >= 0 else
			sys.stderr.write "The local ID must be greater or equal to 0. Got {id}.\n"
		end
		# Pad with nulls.
		nodes.enlarge(id)
		var delta = id - nodes.length
		while delta > 0 do
			nodes.add null
			delta -= 1
		end
		nodes[id] = node
		length += 1
	end
lib/neo4j/graph/sequential_id.nit:78,2--95,4

core $ ArraySet :: add
	redef fun add(e) do if not _array.has(e) then _array.add(e)
lib/core/collection/array.nit:602,2--60

dummy_array $ DummyArray :: add
	redef fun add(value: Int)
	do
		assert full: _length < (_capacity-1)
		var l = _length
		_values[l] = value
		_keys[value] = l
		_length = l + 1
	end
lib/dummy_array/dummy_array.nit:22,2--29,4

core $ AbstractArray :: add
	redef fun add(item) do self[length] = item
lib/core/collection/array.nit:265,2--43

core $ HashSet :: add
	redef fun add(item)
	do
		if _capacity == 0 then enlarge(17) # 17 because magic in `store`
		var i = index_at(item)
		var c = node_at_idx(i, item)
		if c != null then
			c._key = item
		else
			store(i,new HashSetNode[E](item))
		end
	end
lib/core/collection/hash_collection.nit:447,2--457,4

core $ FlatBufferCharView :: add
	redef fun add(c)
	do
		target.add(c)
	end
lib/core/text/flat.nit:1259,2--1262,4

pthreads $ ConcurrentSequence :: add
	redef fun add(e)
	do
		mutex.lock
		real_collection.add e
		mutex.unlock
	end
lib/pthreads/concurrent_collections.nit:291,2--296,4

gamnit $ SpriteSet :: add
	redef fun add(e)
	do
		if contexts_items.has(e.context) then return
		map_sprite e
		super
	end
lib/gamnit/flat/flat_core.nit:991,2--996,4

core $ Array :: add
	redef fun add(item)
	do
		var l = _length
		if _capacity <= l then
			enlarge(l + 1)
		end
		_length = l + 1
		_items.as(not null)[l] = item
	end
lib/core/collection/array.nit:339,2--347,4

pthreads :: redef_collections $ Array :: add
	redef fun add(e)
	do
		mutex.lock
		super
		mutex.unlock
	end
lib/pthreads/redef_collections.nit:40,2--45,4

core $ Bytes :: add
	#     var b = new Bytes.empty
	#     b.add 101
	#     assert b.to_s == "e"
	redef fun add(c) do
		if persisted then regen
		if length >= capacity then
			enlarge(length)
		end
		items[length] = c
		length += 1
	end
lib/core/bytes.nit:514,2--524,4

nitcorn :: reactor $ Interfaces :: add
	redef fun add(e)
	do
		super
		var config = virtual_host.server_config
		if config != null then register_and_listen(e, config)
	end
lib/nitcorn/reactor.nit:201,2--206,4

nitcorn $ VirtualHosts :: add
	redef fun add(e)
	do
		super

		e.server_config = config
	end
lib/nitcorn/server_config.nit:110,2--115,4

nitcorn :: reactor $ VirtualHosts :: add
	redef fun add(e)
	do
		super
		for i in e.interfaces do e.interfaces.register_and_listen(i, config)
	end
lib/nitcorn/reactor.nit:219,2--223,4

pthreads $ ConcurrentArray :: add
	redef fun add(e)
	do
		mutex.lock
		real_collection.add e
		mutex.unlock
	end
lib/pthreads/concurrent_collections.nit:436,2--441,4