core :: SimpleCollection :: 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)
# 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
# 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
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
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
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
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
redef fun add(e)
do
super
e.server_config = config
end
lib/nitcorn/server_config.nit:110,2--115,4
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