java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.NativeArray
- All Implemented Interfaces:
Serializable,Iterable,Collection,List,ConstProperties<Scriptable>,DebuggableObject,PropHolder<Scriptable>,Scriptable,SymbolScriptable
This class implements the Array native object.
- Author:
- Norris Boyd, Mike McCabe
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.DescriptorInfo, ScriptableObject.KeyComparator, ScriptableObject.LambdaGetterFunction, ScriptableObject.LambdaSetterFunction -
Field Summary
FieldsFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, LEGACY_CONST, PERMANENT, READONLY, STRICTLY_READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection c) booleanaddAll(Collection c) protected static booleanarraySetLength(NativeArray builtIn, BuiltInSlot<NativeArray> current, Object id, ScriptableObject.DescriptorInfo info, boolean checkValid, Object key, int index) voidclear()booleanbooleanprotected booleandefineOwnProperty(Context cx, Object id, ScriptableObject.DescriptorInfo desc, boolean checkValid) Defines a property on an object.voiddelete(int index) Removes the indexed property from the object.voiddeleteInternal(CompoundOperationMap<Scriptable> compoundOp, int index) voiddeleteInternal(CompoundOperationMap<Scriptable> compoundOp, String id) get(int index) get(int index, Scriptable start) Returns the value of the indexed property or NOT_FOUND.get(long index) intgetAttributes(int index) Get the attributes of an indexed property.Return the name of the class.Object[]getIds(CompoundOperationMap<Scriptable> map, boolean nonEnumerable, boolean getSymbols) longstatic longgetLengthProperty(Context cx, Scriptable obj) protected ScriptableObject.DescriptorInfogetOwnPropertyDescriptor(Context cx, Object id) booleanhas(int index, Scriptable start) Returns true if the property index is defined.intbooleanisEmpty()iterator()longDeprecated.intlistIterator(int start) voidput(int index, Scriptable start, Object value) Sets the value of the indexed property, creating it if need be.voidput(String id, Scriptable start, Object value) Sets the value of the named property, creating it if need be.remove(int index) booleanbooleanbooleanvoidSets the prototype of the object.intsize()subList(int fromIndex, int toIndex) Object[]toArray()Object[]Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, equivalentValues, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScopeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, defineProperty, defineProperty, get, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliteratorMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Field Details
-
ITERATOR_DESCRIPTOR
-
-
Constructor Details
-
NativeArray
public NativeArray(long lengthArg) -
NativeArray
-
-
Method Details
-
getClassName
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
setPrototype
Description copied from class:ScriptableObjectSets the prototype of the object.- Specified by:
setPrototypein interfaceScriptable- Overrides:
setPrototypein classScriptableObject- Parameters:
p- the prototype to set
-
get
Description copied from class:ScriptableObjectReturns the value of the indexed property or NOT_FOUND.- Specified by:
getin interfacePropHolder<Scriptable>- Specified by:
getin interfaceScriptable- Overrides:
getin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
-
has
Description copied from class:ScriptableObjectReturns true if the property index is defined.- Specified by:
hasin interfacePropHolder<Scriptable>- Specified by:
hasin interfaceScriptable- Overrides:
hasin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
-
put
Description copied from class:ScriptableObjectSets the value of the named property, creating it if need be.If 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.
- Specified by:
putin interfacePropHolder<Scriptable>- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
id- the name of the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
put
Description copied from class:ScriptableObjectSets the value of the indexed property, creating it if need be.- Specified by:
putin interfacePropHolder<Scriptable>- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
delete
public void delete(int index) Description copied from class:ScriptableObjectRemoves the indexed property from the object.If the property is not found, or it has the PERMANENT attribute, no action is taken.
- Specified by:
deletein interfacePropHolder<Scriptable>- Specified by:
deletein interfaceScriptable- Overrides:
deletein classScriptableObject- Parameters:
index- the numeric index for the property- See Also:
-
deleteInternal
-
deleteInternal
-
getIds
public Object[] getIds(CompoundOperationMap<Scriptable> map, boolean nonEnumerable, boolean getSymbols) -
getIndexIds
-
getAttributes
public int getAttributes(int index) Description copied from class:SlotMapOwnerGet the attributes of an indexed property.- Overrides:
getAttributesin classSlotMapOwner<Scriptable>- Parameters:
index- the numeric index for the property- Returns:
- the bitset of attributes
- See Also:
-
getOwnPropertyDescriptor
- Overrides:
getOwnPropertyDescriptorin classScriptableObject
-
defineOwnProperty
protected boolean defineOwnProperty(Context cx, Object id, ScriptableObject.DescriptorInfo desc, boolean checkValid) Description copied from class:ScriptableObjectDefines a property on an object.Based on [[DefineOwnProperty]] from 8.12.10 of the spec. see [[DefineOwnProperty]]
- Overrides:
defineOwnPropertyin classScriptableObject- Parameters:
cx- the current Contextid- the name/index of the propertydesc- the new property descriptor, as described in 8.6.1checkValid- whether to perform validity checks- Returns:
- always true at the moment
-
arraySetLength
protected static boolean arraySetLength(NativeArray builtIn, BuiltInSlot<NativeArray> current, Object id, ScriptableObject.DescriptorInfo info, boolean checkValid, Object key, int index) -
getLength
public long getLength() -
jsGet_length
Deprecated.UsegetLength()instead. -
getLengthProperty
-
contains
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceList
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList
-
containsAll
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceList
-
size
public int size()- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- Overrides:
sizein classScriptableObject
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList- Overrides:
isEmptyin classScriptableObject
-
get
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList
-
listIterator
- Specified by:
listIteratorin interfaceList
-
add
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceList
-
remove
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceList
-
addAll
- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceList
-
removeAll
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList
-
retainAll
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList
-
clear
public void clear()- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList
-
add
-
addAll
-
set
-
remove
-
subList
-
getLength()instead.