Static variables
Static methods
Constructor
new()
Creates a new Map.
This becomes a constructor call to one of the specialization types in
the output. The rules for that are as follows:
1. if K
is a String
, haxe.ds.StringMap
is used
2. if K
is an Int
, haxe.ds.GoIntMap
is used
3. if K
is an EnumValue
, haxe.ds.EnumValueMap
is used
4. if K
is any other class or structure, haxe.ds.GoObjectMap
is used
5. if K
is any other type, it causes a compile-time error
(Cpp) Map does not use weak keys on GoObjectMap
by default.
Methods
inline__copy__(this:IMap<K, V>):GoMap<K, V>
Returns a shallow copy of this
map.
The order of values is undefined.
inline__exists__(this:IMap<K, V>, key:K):Bool
Returns true if key
has a mapping, false otherwise.
If key
is null
, the result is unspecified.
inline__get__(this:IMap<K, V>, key:K):Null<V>
Returns the current mapping of key
.
If no such mapping exists, null
is returned.
Note that a check like map.get(key) == null
can hold for two reasons:
1. the map has no mapping for key
2. the map has a mapping with a value of null
If it is important to distinguish these cases, exists()
should be
used.
If key
is null
, the result is unspecified.
inline__keys__(this:IMap<K, V>):Iterator<K>
Returns an Iterator over the keys of this
Map.
The order of keys is undefined.
inline__remove__(this:IMap<K, V>, key:K):Bool
Removes the mapping of key
and returns true if such a mapping existed,
false otherwise.
If key
is null
, the result is unspecified.
inline__set__(this:IMap<K, V>, key:K, value:V):Void
Maps key
to value
.
If key
already has a mapping, the previous value disappears.
If key
is null
, the result is unspecified.
inlineiterator(this:IMap<K, V>):Iterator<V>
Returns an Iterator over the values of this
Map.
The order of values is undefined.
inlinekeyValueIterator(this:IMap<K, V>):KeyValueIterator<K, V>
Returns an Iterator over the keys and values of this
Map.
The order of values is undefined.