@JsType(name="WeakMap",
isNative=true,
namespace="<global>")
public class JsWeakMap<K,V>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JsWeakMap.Entry<K,V> |
| Constructor and Description |
|---|
JsWeakMap()
The WeakMap() constructor creates WeakMap objects which are a collections of key/value pairs in which the keys are weakly referenced.
|
JsWeakMap(JsIterable<JsWeakMap.Entry<K,V>> pairs)
The WeakMap() constructor creates WeakMap objects which are a collections of key/value pairs in which the keys are weakly referenced.
|
JsWeakMap(JsWeakMap.Entry<K,V>... pairs)
The WeakMap() constructor creates WeakMap objects which are a collections of key/value pairs in which the keys are weakly referenced.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(K key)
The delete() method removes the specified element from a WeakMap object.
|
V |
get(K key)
The get() method returns a specified element from a WeakMap object.
|
boolean |
has(K key)
The has() method returns a boolean indicating whether an element with the specified key exists in the WeakMap object or not.
|
JsWeakMap<K,V> |
set(K key,
V value)
The set() method adds a new element with a specified key and value to a WeakMap object.
|
public JsWeakMap()
@SafeVarargs
public JsWeakMap(@Nonnull
JsWeakMap.Entry<K,V>... pairs)
pairs - an array of pairs that will be added to the WeakMap.public JsWeakMap(@Nonnull
JsIterable<JsWeakMap.Entry<K,V>> pairs)
pairs - an iterable containing pairs that will be added to the WeakMap.public boolean delete(@Nonnull
K key)
key - the key of the element to remove from the WeakMap object.@Nullable public V get(@Nonnull K key)
key - the key of the element to return from the WeakMap object.public boolean has(@Nonnull
K key)
key - the key of the element to test for presence in the WeakMap object.@Nonnull public JsWeakMap<K,V> set(@Nonnull K key, @Nonnull V value)
key - the key of the element to add to the WeakMap object.value - the value of the element to add to the WeakMap object.