SimpleEntry
Defined in: src/abstract/AbstractMap.ts:408
A mutable key/value pair (setValue works), handy for building a custom map’s entry set. Equality and hash follow
the map-entry contract, so it equals any entry with an equal key and value; toString() gives key=value.
Type Parameters
Section titled “Type Parameters”K
V
Implements
Section titled “Implements”MapEntry<K,V>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SimpleEntry<
K,V>(entry):SimpleEntry<K,V>
Defined in: src/abstract/AbstractMap.ts:412
Creates an entry with the key and value of entry.
Parameters
Section titled “Parameters”MapEntry<K, V>
Returns
Section titled “Returns”SimpleEntry<K, V>
Constructor
Section titled “Constructor”new SimpleEntry<
K,V>(key,value):SimpleEntry<K,V>
Defined in: src/abstract/AbstractMap.ts:414
Creates an entry mapping key to value; both may be null.
Parameters
Section titled “Parameters”K
V
Returns
Section titled “Returns”SimpleEntry<K, V>
Methods
Section titled “Methods”[INSPECT]()
Section titled “[INSPECT]()”[INSPECT]():
string
Defined in: src/abstract/AbstractMap.ts:443
Node’s util.inspect hook: console.log prints the toString() form.
Returns
Section titled “Returns”string
equals()
Section titled “equals()”equals(
o):boolean
Defined in: src/abstract/AbstractMap.ts:435
Returns true if o is a map entry with an equal key and an equal value.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”getKey()
Section titled “getKey()”getKey():
K
Defined in: src/abstract/AbstractMap.ts:421
Returns the key.
Returns
Section titled “Returns”K
Implementation of
Section titled “Implementation of”getValue()
Section titled “getValue()”getValue():
V
Defined in: src/abstract/AbstractMap.ts:425
Returns the value.
Returns
Section titled “Returns”V
Implementation of
Section titled “Implementation of”hashCode()
Section titled “hashCode()”hashCode():
number
Defined in: src/abstract/AbstractMap.ts:439
Returns hashCode(key) ^ hashCode(value).
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”setValue()
Section titled “setValue()”setValue(
value):V
Defined in: src/abstract/AbstractMap.ts:429
Replaces the value and returns the old one.
Parameters
Section titled “Parameters”V
Returns
Section titled “Returns”V
Implementation of
Section titled “Implementation of”toString()
Section titled “toString()”toString():
string
Defined in: src/abstract/AbstractMap.ts:447
Returns key=value.
Returns
Section titled “Returns”string