Class NativeWeakSet

  • All Implemented Interfaces:
    java.io.Serializable, ConstProperties, DebuggableObject, IdFunctionCall, Scriptable, SymbolScriptable

    public class NativeWeakSet
    extends IdScriptableObject
    This is an implementation of the ES6 WeakSet class. It is very similar to NativeWeakMap, with the exception being that it doesn't store any values. Java will GC the key only when there is no longer any reference to it other than the weak reference. That means that it is important that the "value" that we put in the WeakHashMap here is not one that contains the key.
    See Also:
    Serialized Form
    • Constructor Detail

      • NativeWeakSet

        public NativeWeakSet()
    • Method Detail

      • init

        static void init​(Scriptable scope,
                         boolean sealed)
      • getClassName

        public java.lang.String getClassName()
        Description copied from class: ScriptableObject
        Return the name of the class.

        This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.

        Specified by:
        getClassName in interface Scriptable
        Specified by:
        getClassName in class ScriptableObject
      • js_add

        private java.lang.Object js_add​(java.lang.Object key)
      • js_delete

        private java.lang.Object js_delete​(java.lang.Object key)
      • js_has

        private java.lang.Object js_has​(java.lang.Object key)
      • readObject

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException