Class NativeArray

    • Constructor Detail

      • NativeArray

        public NativeArray​(long lengthArg)
      • NativeArray

        public NativeArray​(java.lang.Object[] array)
    • Method Detail

      • 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
      • setInstanceIdAttributes

        protected void setInstanceIdAttributes​(int id,
                                               int attr)
        Description copied from class: IdScriptableObject
        Update the attributes of the given instance property. Classes which want to support changing property attributes via Object.defineProperty must override this method. The default implementation throws InternalError.
        Overrides:
        setInstanceIdAttributes in class IdScriptableObject
        Parameters:
        id - the instance property id
        attr - the new attribute bitset
      • getInstanceIdValue

        protected java.lang.Object getInstanceIdValue​(int id)
        Description copied from class: IdScriptableObject
        Get id value. * If id value is constant, descendant can call cacheIdValue to store * value in the permanent cache. * Default implementation creates IdFunctionObject instance for given id * and cache its value
        Overrides:
        getInstanceIdValue in class IdScriptableObject
      • setInstanceIdValue

        protected void setInstanceIdValue​(int id,
                                          java.lang.Object value)
        Description copied from class: IdScriptableObject
        Set or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.
        Overrides:
        setInstanceIdValue in class IdScriptableObject
      • get

        public java.lang.Object get​(int index,
                                    Scriptable start)
        Description copied from class: ScriptableObject
        Returns the value of the indexed property or NOT_FOUND.
        Specified by:
        get in interface Scriptable
        Overrides:
        get in class ScriptableObject
        Parameters:
        index - the numeric index for the property
        start - the object in which the lookup began
        Returns:
        the value of the property (may be null), or NOT_FOUND
        See Also:
        Scriptable.get(String,Scriptable)
      • getIds

        public java.lang.Object[] getIds​(boolean nonEnumerable,
                                         boolean getSymbols)
      • getIndexIds

        public java.util.List<java.lang.Integer> getIndexIds()
      • getDefaultValue

        public java.lang.Object getDefaultValue​(java.lang.Class<?> hint)
        Description copied from class: ScriptableObject
        Implements the [[DefaultValue]] internal method.

        Note that the toPrimitive conversion is a no-op for every type other than Object, for which [[DefaultValue]] is called. See ECMA 9.1.

        A hint of null means "no hint".

        Specified by:
        getDefaultValue in interface Scriptable
        Overrides:
        getDefaultValue in class ScriptableObject
        Parameters:
        hint - the type hint
        Returns:
        the default value for the object

        See ECMA 8.6.2.6.

      • defineOwnProperty

        protected void defineOwnProperty​(Context cx,
                                         java.lang.Object id,
                                         ScriptableObject desc,
                                         boolean checkValid)
        Description copied from class: ScriptableObject
        Defines a property on an object.

        Based on [[DefineOwnProperty]] from 8.12.10 of the spec.

        Overrides:
        defineOwnProperty in class IdScriptableObject
        Parameters:
        cx - the current Context
        id - the name/index of the property
        desc - the new property descriptor, as described in 8.6.1
        checkValid - whether to perform validity checks
      • getLength

        public long getLength()
      • jsGet_length

        @Deprecated
        public long jsGet_length()
        Deprecated.
        Use getLength() instead.
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.List
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
      • toArray

        public java.lang.Object[] toArray​(java.lang.Object[] a)
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
      • containsAll

        public boolean containsAll​(java.util.Collection c)
        Specified by:
        containsAll in interface java.util.Collection
        Specified by:
        containsAll in interface java.util.List
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Overrides:
        size in class ScriptableObject
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection
        Specified by:
        isEmpty in interface java.util.List
        Overrides:
        isEmpty in class ScriptableObject
      • get

        public java.lang.Object get​(long index)
      • get

        public java.lang.Object get​(int index)
        Specified by:
        get in interface java.util.List
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List
      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in interface java.util.List
      • listIterator

        public java.util.ListIterator listIterator()
        Specified by:
        listIterator in interface java.util.List
      • listIterator

        public java.util.ListIterator listIterator​(int start)
        Specified by:
        listIterator in interface java.util.List
      • add

        public boolean add​(java.lang.Object o)
        Specified by:
        add in interface java.util.Collection
        Specified by:
        add in interface java.util.List
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.List
      • addAll

        public boolean addAll​(java.util.Collection c)
        Specified by:
        addAll in interface java.util.Collection
        Specified by:
        addAll in interface java.util.List
      • removeAll

        public boolean removeAll​(java.util.Collection c)
        Specified by:
        removeAll in interface java.util.Collection
        Specified by:
        removeAll in interface java.util.List
      • retainAll

        public boolean retainAll​(java.util.Collection c)
        Specified by:
        retainAll in interface java.util.Collection
        Specified by:
        retainAll in interface java.util.List
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection
        Specified by:
        clear in interface java.util.List
      • add

        public void add​(int index,
                        java.lang.Object element)
        Specified by:
        add in interface java.util.List
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection c)
        Specified by:
        addAll in interface java.util.List
      • set

        public java.lang.Object set​(int index,
                                    java.lang.Object element)
        Specified by:
        set in interface java.util.List
      • remove

        public java.lang.Object remove​(int index)
        Specified by:
        remove in interface java.util.List
      • subList

        public java.util.List subList​(int fromIndex,
                                      int toIndex)
        Specified by:
        subList in interface java.util.List