public class NativeArray extends ScriptableObject implements List
ScriptableObject.KeyComparator, ScriptableObject.LambdaGetterFunction, ScriptableObject.LambdaSetterFunctionCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTNOT_FOUND| Constructor and Description |
|---|
NativeArray(long lengthArg) |
NativeArray(Object[] array) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Object element) |
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
protected static boolean |
arraySetLength(NativeArray builtIn,
BuiltInSlot<NativeArray> current,
Object id,
ScriptableObject desc,
boolean checkValid,
Object key,
int index) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
protected boolean |
defineOwnProperty(Context cx,
Object id,
ScriptableObject desc,
boolean checkValid)
Defines a property on an object.
|
void |
delete(int index)
Removes the indexed property from the object.
|
Object |
get(int index) |
Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND.
|
Object |
get(long index) |
int |
getAttributes(int index)
Get the attributes of an indexed property.
|
String |
getClassName()
Return the name of the class.
|
Object |
getDefaultValue(Class<?> hint)
Implements the [[DefaultValue]] internal method.
|
Object[] |
getIds(boolean nonEnumerable,
boolean getSymbols) |
List<Integer> |
getIndexIds() |
long |
getLength() |
protected ScriptableObject |
getOwnPropertyDescriptor(Context cx,
Object id) |
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined.
|
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator |
iterator() |
long |
jsGet_length()
Deprecated.
Use
getLength() instead. |
int |
lastIndexOf(Object o) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int start) |
void |
put(int index,
Scriptable start,
Object value)
Sets the value of the indexed property, creating it if need be.
|
void |
put(String id,
Scriptable start,
Object value)
Sets the value of the named property, creating it if need be.
|
Object |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
boolean |
retainAll(Collection c) |
Object |
set(int index,
Object element) |
void |
setPrototype(Scriptable p)
Sets the prototype of the object.
|
int |
size() |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChangeForSlot, checkPropertyDefinition, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScopecreateSlotMapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streampublic NativeArray(long lengthArg)
public NativeArray(Object[] array)
public String getClassName()
ScriptableObjectThis is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
getClassName in interface ScriptablegetClassName in class ScriptableObjectpublic void setPrototype(Scriptable p)
ScriptableObjectsetPrototype in interface ScriptablesetPrototype in class ScriptableObjectp - the prototype to setpublic Object get(int index, Scriptable start)
ScriptableObjectget in interface Scriptableget in class ScriptableObjectindex - the numeric index for the propertystart - the object in which the lookup beganScriptable.get(String,Scriptable)public boolean has(int index,
Scriptable start)
ScriptableObjecthas in interface Scriptablehas in class ScriptableObjectindex - the numeric index for the propertystart - the object in which the lookup beganScriptable.get(int, Scriptable),
ScriptableObject.getProperty(Scriptable, int)public void put(String id, Scriptable start, Object value)
ScriptableObjectIf the property was created using defineProperty, the appropriate setter method is called.
If the property's attributes include READONLY, no action is taken. This method will actually set the property in the start object.
put in interface Scriptableput in class ScriptableObjectid - the name of the propertystart - the object whose property is being setvalue - value to set the property toScriptable.has(String, Scriptable),
Scriptable.get(String, Scriptable),
ScriptableObject.putProperty(Scriptable, String, Object),
Context.toObject(Object, Scriptable)public void put(int index,
Scriptable start,
Object value)
ScriptableObjectput in interface Scriptableput in class ScriptableObjectindex - the numeric index for the propertystart - the object whose property is being setvalue - value to set the property toScriptable.has(int, Scriptable),
Scriptable.get(int, Scriptable),
ScriptableObject.putProperty(Scriptable, int, Object),
Context.toObject(Object, Scriptable)public void delete(int index)
ScriptableObjectIf the property is not found, or it has the PERMANENT attribute, no action is taken.
delete in interface Scriptabledelete in class ScriptableObjectindex - the numeric index for the propertyScriptable.get(int, Scriptable),
ScriptableObject.deleteProperty(Scriptable, int)public Object[] getIds(boolean nonEnumerable, boolean getSymbols)
public Object getDefaultValue(Class<?> hint)
ScriptableObjectNote 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".
getDefaultValue in interface ScriptablegetDefaultValue in class ScriptableObjecthint - the type hintSee ECMA 8.6.2.6.
public int getAttributes(int index)
ScriptableObjectgetAttributes in class ScriptableObjectindex - the numeric index for the propertyScriptableObject.has(String, Scriptable),
ScriptableObject.READONLY,
ScriptableObject.DONTENUM,
ScriptableObject.PERMANENT,
ScriptableObject.EMPTYprotected ScriptableObject getOwnPropertyDescriptor(Context cx, Object id)
getOwnPropertyDescriptor in class ScriptableObjectprotected boolean defineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid)
ScriptableObjectBased on [[DefineOwnProperty]] from 8.12.10 of the spec. see [[DefineOwnProperty]]
defineOwnProperty in class ScriptableObjectcx - the current Contextid - the name/index of the propertydesc - the new property descriptor, as described in 8.6.1checkValid - whether to perform validity checksprotected static boolean arraySetLength(NativeArray builtIn, BuiltInSlot<NativeArray> current, Object id, ScriptableObject desc, boolean checkValid, Object key, int index)
public long getLength()
@Deprecated public long jsGet_length()
getLength() instead.public boolean contains(Object o)
contains in interface Collectioncontains in interface Listpublic Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Listpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Listpublic int size()
size in interface Collectionsize in interface Listsize in class ScriptableObjectpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListisEmpty in class ScriptableObjectpublic Object get(long index)
public int lastIndexOf(Object o)
lastIndexOf in interface Listpublic Iterator iterator()
public ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int start)
listIterator in interface Listpublic boolean add(Object o)
add in interface Collectionadd in interface Listpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Listpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Listpublic void clear()
clear in interface Collectionclear in interface Listpublic boolean addAll(int index,
Collection c)
Copyright © 2025 HtmlUnit. All rights reserved.