core :: HashMapValues :: defaultinit
core $ HashMapValues :: SELF
Type of this instance, automatically specialized in every classcore $ HashMapValues :: remove_all
Remove all occurrences ofitem
core :: Collection :: CONCURRENT
Type of the concurrent variant of this collectioncore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Collection :: combinations
Allr
-length combinations on self (in same order) without repeated elements.
core :: Collection :: combinations_with_replacement
Allr
-length combination on self (in same order) with repeated elements.
core :: Object :: defaultinit
core :: HashMapValues :: defaultinit
core :: Collection :: defaultinit
core :: Collection :: has_all
Does the collection contain at least each element ofother
?
core :: Collection :: has_any
Does the collection contain at least one element ofother
?
core :: Collection :: has_exactly
Does the collection contain exactly all the elements ofother
?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).core :: Collection :: permutations
Allr
-length permutations on self (all possible ordering) without repeated elements.
core :: Collection :: product
Cartesian product, overr
times self
.
core :: RemovableCollection :: remove
Remove an occurrence ofitem
core :: RemovableCollection :: remove_all
Remove all occurrences ofitem
core :: Collection :: serialize_to_pure_json
Utility to serialize a normal Json arraycore :: Collection :: to_concurrent
Wrapsself
in a thread-safe collection
core :: Collection :: to_counter
Create and fill up a counter with the elements of `self.core :: Collection :: to_curlslist
Convert Collection[String] to CURLSListcore :: Collection :: to_shuffle
Return a new array made of elements in a random order.
# View of the values of a Map
private class HashMapValues[K, V]
super RemovableCollection[V]
# The original map
var map: HashMap[K, V]
redef fun count(item)
do
var nb = 0
var c = self.map._first_item
while c != null do
if c._value == item then nb += 1
c = c._next_item
end
return nb
end
redef fun first do return self.map._first_item._value
redef fun has(item)
do
var c = self.map._first_item
while c != null do
if c._value == item then return true
c = c._next_item
end
return false
end
redef fun has_only(item)
do
var c = self.map._first_item
while c != null do
if c._value != item then return false
c = c._next_item
end
return true
end
redef fun is_empty do return self.map.is_empty
redef fun length do return self.map.length
redef fun iterator do return new MapValuesIterator[K, V](self.map.iterator)
redef fun clear do self.map.clear
redef fun remove(item)
do
var map = self.map
var c = map._first_item
while c != null do
if c._value == item then
map.remove_node(c._key)
return
end
c = c._next_item
end
end
redef fun remove_all(item)
do
var map = self.map
var c = map._first_item
while c != null do
if c._value == item then
map.remove_node(c._key)
end
c = c._next_item
end
end
end
lib/core/collection/hash_collection.nit:305,1--374,3