Class JSHashMap
java.lang.Object
com.oracle.truffle.js.runtime.util.JSHashMap
ES6-compliant hash map implementation. A single node links each entry into both a hash bucket and
the insertion-order list. Removed nodes retain their order links so that live cursors can recover
from removal and clear operations.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()copy()getOrDefault(Object key, int hashCode, Object defaultValue) getOrInsert(Object key, int hashCode, Object value) booleanvoidInsert new entry, if key does not already exist, otherwise update the existing entry's value.putIfAbsent(Object key, int hashCode, Object value) Inserts a new entry if the key is absent.booleanintsize()toString()
-
Constructor Details
-
JSHashMap
public JSHashMap()
-
-
Method Details
-
size
public int size() -
put
-
putIfAbsent
-
getOrInsert
-
get
-
getOrDefault
-
has
-
remove
-
clear
public void clear() -
toString
-
getEntries
-
copy
-