MapIterator
over a HashMap
.core :: HashMapIterator :: defaultinit
core :: HashMapIterator :: node=
The current nodecore $ HashMapIterator :: SELF
Type of this instance, automatically specialized in every classcore $ HashMapIterator :: init
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: HashMapIterator :: defaultinit
core :: Object :: defaultinit
core :: MapIterator :: defaultinit
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 :: HashMapIterator :: node=
The current nodecore :: Object :: output_class_name
Display class name on stdout (debug only).core :: MapIterator
Iterators for Map.
# A `MapIterator` over a `HashMap`.
private class HashMapIterator[K, V]
super MapIterator[K, V]
redef fun is_ok do return _node != null
redef fun item
do
assert is_ok
return _node._value
end
#redef fun item=(value)
#do
# assert is_ok
# _node.second = value
#end
redef fun key
do
assert is_ok
return _node._key
end
redef fun next
do
assert is_ok
_node = _node._next_item
end
# The map to iterate on
var map: HashMap[K, V]
# The current node
var node: nullable HashMapNode[K, V] = null
init
do
_map = map
_node = _map._first_item
end
end
lib/core/collection/hash_collection.nit:382,1--422,3