W3cubDocs

/Haxe

WeakMap<K, V>

package haxe.ds

implements IMap<K, V>

@:headerClassCode("\n inline void set(Dynamic key, ::null value) { __object_hash_set(h,key,value,true); }\n inline void set(Dynamic key, bool value) { __object_hash_set(h,key,value,true); }\n inline void set(Dynamic key, char value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, unsigned char value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, signed char value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, short value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, unsigned short value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, int value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, unsigned int value) { __object_hash_set_int(h,key,value,true); }\n inline void set(Dynamic key, float value) { __object_hash_set_float(h,key,value,true); }\n inline void set(Dynamic key, double value) { __object_hash_set_float(h,key,value,true); }\n inline void set(Dynamic key, ::String value) { __object_hash_set_string(h,key,value,true); }\n\n template<typename V, typename H>\n inline void set(Dynamic key, const ::cpp::Struct<V,H> &value) {__object_hash_set(h,key,value,true); }\n template<typename V>\n inline void set(Dynamic key, const ::cpp::Pointer<V> &value) {__object_hash_set(h,key,(Dynamic)value,true ); }\n template<typename V>\n inline void set(Dynamic key, const ::cpp::Function<V> &value) {__object_hash_set(h,key,(Dynamic)value,true ); }\n")@:coreApi Available on all platforms

WeakMap allows mapping of object keys to arbitrary values.

The keys are considered to be weak references on static targets.

See Map for documentation details.

See:

Constructor

new ()

Creates a new WeakMap.

Methods

@:has_untyped exists (key:K ):Bool

See Map.exists

@:has_untyped get (key:K ):Null<V>

See Map.get

@:has_untyped iterator ():Iterator<V>

Available on cpp, cs, flash, hl, js, lua, macro, neko, php, python

See Map.iterator

iterator ():Iterator<V>

Available on java

Returns an iterator of all values in the hashtable. Implementation detail: Do not set() any new value while iterating, as it may cause a resize, which will break iteration

keys ():Iterator<K>

Available on java

Returns an iterator of all keys in the hashtable. Implementation detail: Do not set() any new value while iterating, as it may cause a resize, which will break iteration

@:has_untyped keys ():Iterator<K>

Available on cpp, cs, flash, hl, js, lua, macro, neko, php, python

See Map.keys

@:has_untyped remove (key:K ):Bool

See Map.remove

@:has_untyped set (key:K, value:V ):Void

See Map.set

toString ():String

Available on java

Returns an displayable representation of the hashtable content.

@:has_untyped toString ():String

Available on cpp, cs, flash, hl, js, lua, macro, neko, php, python

See Map.toString

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/haxe/ds/WeakMap.html