Note that self
and values
are views on the same data;
therefore any modification of one is visible on the other.
var x = new HashMap[String, Int]
x["four"] = 4
assert x.values.has(4) == true
assert x.values.has(5) == false
# Return the point of view of self on the values only.
# Note that `self` and `values` are views on the same data;
# therefore any modification of one is visible on the other.
#
# var x = new HashMap[String, Int]
# x["four"] = 4
# assert x.values.has(4) == true
# assert x.values.has(5) == false
fun values: Collection[V] is abstract
lib/core/collection/abstract_collection.nit:585,2--593,38
redef fun values: RemovableCollection[V] is abstract
lib/core/collection/abstract_collection.nit:763,2--53
redef var values: RemovableCollection[V] = new HashMapValues[K, V](self) is lazy
lib/core/collection/hash_collection.nit:280,2--81
redef var values: RemovableCollection[E] = new ArrayMapValues[K, E](self) is lazy
lib/core/collection/array.nit:717,2--82