public class NativeArray extends IdScriptableObject implements java.util.List
| Modifier and Type | Class and Description |
|---|---|
static class |
NativeArray.ElementComparator |
static class |
NativeArray.StringLikeComparator |
ScriptableObject.KeyComparatorCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTNOT_FOUND| Constructor and Description |
|---|
NativeArray(long lengthArg) |
NativeArray(java.lang.Object[] array) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Object element) |
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
boolean |
addAll(int index,
java.util.Collection c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
protected void |
defineOwnProperty(Context cx,
java.lang.Object id,
ScriptableObject desc,
boolean checkValid)
Defines a property on an object.
|
void |
delete(int index)
Removes the indexed property from the object.
|
java.lang.Object |
execIdCall(IdFunctionObject f,
Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable
should be returned.
|
protected void |
fillConstructorProperties(IdFunctionObject ctor) |
protected int |
findInstanceIdInfo(java.lang.String s)
Map name to id of instance property.
|
protected int |
findPrototypeId(java.lang.String s) |
protected int |
findPrototypeId(Symbol k) |
java.lang.Object |
get(int index) |
java.lang.Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND.
|
java.lang.Object |
get(long index) |
int |
getAttributes(int index)
Get the attributes of an indexed property.
|
java.lang.String |
getClassName()
Return the name of the class.
|
java.lang.Object |
getDefaultValue(java.lang.Class<?> hint)
Implements the [[DefaultValue]] internal method.
|
java.lang.Object[] |
getIds(boolean nonEnumerable,
boolean getSymbols) |
java.util.List<java.lang.Integer> |
getIndexIds() |
protected java.lang.String |
getInstanceIdName(int id)
Map id back to property name it defines.
|
protected java.lang.Object |
getInstanceIdValue(int id)
Get id value.
|
long |
getLength() |
protected int |
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.
|
protected ScriptableObject |
getOwnPropertyDescriptor(Context cx,
java.lang.Object id) |
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined.
|
int |
indexOf(java.lang.Object o) |
protected void |
initPrototypeId(int id) |
boolean |
isEmpty() |
java.util.Iterator |
iterator() |
long |
jsGet_length()
Deprecated.
Use
getLength() instead. |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator |
listIterator() |
java.util.ListIterator |
listIterator(int start) |
void |
put(int index,
Scriptable start,
java.lang.Object value)
Sets the value of the indexed property, creating it if need be.
|
void |
put(java.lang.String id,
Scriptable start,
java.lang.Object value)
Sets the value of the named property, creating it if need be.
|
java.lang.Object |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
boolean |
retainAll(java.util.Collection c) |
java.lang.Object |
set(int index,
java.lang.Object element) |
protected void |
setInstanceIdAttributes(int id,
int attr)
Update the attributes of the given instance property.
|
protected void |
setInstanceIdValue(int id,
java.lang.Object value)
Set or delete id value.
|
int |
size() |
java.util.List |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, delete, delete, ensureType, exportAsJSClass, findInstanceIdInfo, get, get, getAttributes, getAttributes, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, setAttributesapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototypepublic NativeArray(long lengthArg)
public NativeArray(java.lang.Object[] array)
public java.lang.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 ScriptableObjectprotected int getMaxInstanceId()
IdScriptableObjectgetMaxInstanceId in class IdScriptableObjectprotected void setInstanceIdAttributes(int id,
int attr)
IdScriptableObjectsetInstanceIdAttributes in class IdScriptableObjectid - the instance property idattr - the new attribute bitsetprotected int findInstanceIdInfo(java.lang.String s)
IdScriptableObjectIdScriptableObject.instanceIdInfo(int, int).findInstanceIdInfo in class IdScriptableObjectprotected java.lang.String getInstanceIdName(int id)
IdScriptableObjectgetInstanceIdName in class IdScriptableObjectprotected java.lang.Object getInstanceIdValue(int id)
IdScriptableObjectgetInstanceIdValue in class IdScriptableObjectprotected void setInstanceIdValue(int id,
java.lang.Object value)
IdScriptableObjectsetInstanceIdValue in class IdScriptableObjectprotected void fillConstructorProperties(IdFunctionObject ctor)
fillConstructorProperties in class IdScriptableObjectprotected void initPrototypeId(int id)
initPrototypeId in class IdScriptableObjectpublic java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
IdScriptableObjectexecIdCall in interface IdFunctionCallexecIdCall in class IdScriptableObjectpublic java.lang.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(java.lang.String id,
Scriptable start,
java.lang.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 IdScriptableObjectid - 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,
java.lang.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 java.lang.Object[] getIds(boolean nonEnumerable,
boolean getSymbols)
public java.util.List<java.lang.Integer> getIndexIds()
public java.lang.Object getDefaultValue(java.lang.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, java.lang.Object id)
getOwnPropertyDescriptor in class IdScriptableObjectprotected void defineOwnProperty(Context cx, java.lang.Object id, ScriptableObject desc, boolean checkValid)
ScriptableObjectBased on [[DefineOwnProperty]] from 8.12.10 of the spec.
defineOwnProperty in class IdScriptableObjectcx - the current Contextid - the name/index of the propertydesc - the new property descriptor, as described in 8.6.1checkValid - whether to perform validity checkspublic long getLength()
@Deprecated public long jsGet_length()
getLength() instead.public boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Listpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class ScriptableObjectpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in class ScriptableObjectpublic java.lang.Object get(long index)
public java.lang.Object get(int index)
get in interface java.util.Listpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.Listpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.Listpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listpublic java.util.ListIterator listIterator()
listIterator in interface java.util.Listpublic java.util.ListIterator listIterator(int start)
listIterator in interface java.util.Listpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Listpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.Listpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Listpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Listpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Listpublic void add(int index,
java.lang.Object element)
add in interface java.util.Listpublic boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.Listpublic java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listpublic java.lang.Object remove(int index)
remove in interface java.util.Listpublic java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.Listprotected int findPrototypeId(Symbol k)
findPrototypeId in class IdScriptableObjectprotected int findPrototypeId(java.lang.String s)
findPrototypeId in class IdScriptableObject