Class JSMapObject

All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject

public final class JSMapObject extends JSNonProxyObject
  • Constructor Details

    • JSMapObject

      protected JSMapObject(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto)
  • Method Details

    • size

      public int size()
    • getOrDefault

      public Object getOrDefault(Object key, int hashCode, Object defaultValue)
    • has

      public boolean has(Object key, int hashCode)
    • remove

      public boolean remove(Object key, int hashCode)
    • clear

      public void clear()
    • put

      public void put(Object key, int hashCode, Object value)
    • getOrInsert

      public Object getOrInsert(Object key, int hashCode, Object value)
    • getEntries

      public JSHashMap.Cursor getEntries()
    • getClassName

      public com.oracle.truffle.api.strings.TruffleString getClassName()
      Description copied from class: JSDynamicObject
      The [[Class]] internal property. For ES5, this is the second part of what Object.prototype.toString.call(myObj) returns, e.g. "[object Array]".
      Overrides:
      getClassName in class JSNonProxyObject
    • hasHashEntries

      public boolean hasHashEntries()
    • toDisplayStringImpl

      public com.oracle.truffle.api.strings.TruffleString toDisplayStringImpl(boolean allowSideEffects, ToDisplayStringFormat format, int depth)
      Description copied from class: JSDynamicObject
      A more informative toString variant, mainly used for error messages.
      Overrides:
      toDisplayStringImpl in class JSNonProxyObject
      Parameters:
      format - formatting parameters
      depth - current nesting depth