public class NativeArray extends IdScriptableObject implements List
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_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) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
void |
defineOwnProperty(Context cx,
Object id,
ScriptableObject desc)
Defines a property on an object
Based on [[DefineOwnProperty]] from 8.12.10 of the spec
|
void |
delete(int index)
Removes the indexed property from the object.
|
Object |
execIdCall(IdFunctionObject f,
Context cx,
Scriptable scope,
Scriptable thisObj,
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(String s)
Map name to id of instance property.
|
protected int |
findPrototypeId(String s) |
Object |
get(int index) |
Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND.
|
Object |
get(long index) |
Object[] |
getAllIds()
Returns an array of ids for the properties of the object.
|
String |
getClassName()
Return the name of the class.
|
Object |
getDefaultValue(Class<?> hint)
Implements the [[DefaultValue]] internal method.
|
Object[] |
getIds()
Returns an array of ids for the properties of the object.
|
Integer[] |
getIndexIds() |
protected String |
getInstanceIdName(int id)
Map id back to property name it defines.
|
protected Object |
getInstanceIdValue(int id)
Get id value.
|
long |
getLength() |
protected int |
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.
|
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) |
protected void |
initPrototypeId(int id) |
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) |
protected void |
setInstanceIdValue(int id,
Object value)
Set or delete id value.
|
int |
size() |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, setAttributes
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
public NativeArray(long lengthArg)
public NativeArray(Object[] array)
public String getClassName()
ScriptableObject
getClassName
in interface Scriptable
getClassName
in class ScriptableObject
protected int getMaxInstanceId()
IdScriptableObject
getMaxInstanceId
in class IdScriptableObject
protected int findInstanceIdInfo(String s)
IdScriptableObject
IdScriptableObject.instanceIdInfo(int, int)
.findInstanceIdInfo
in class IdScriptableObject
protected String getInstanceIdName(int id)
IdScriptableObject
getInstanceIdName
in class IdScriptableObject
protected Object getInstanceIdValue(int id)
IdScriptableObject
getInstanceIdValue
in class IdScriptableObject
protected void setInstanceIdValue(int id, Object value)
IdScriptableObject
setInstanceIdValue
in class IdScriptableObject
protected void fillConstructorProperties(IdFunctionObject ctor)
fillConstructorProperties
in class IdScriptableObject
protected void initPrototypeId(int id)
initPrototypeId
in class IdScriptableObject
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
IdScriptableObject
execIdCall
in interface IdFunctionCall
execIdCall
in class IdScriptableObject
public Object get(int index, Scriptable start)
ScriptableObject
get
in interface Scriptable
get
in class ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup beganScriptable.get(String,Scriptable)
public boolean has(int index, Scriptable start)
ScriptableObject
has
in interface Scriptable
has
in class ScriptableObject
index
- 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)
ScriptableObject
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 Scriptable
put
in class IdScriptableObject
id
- 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)
ScriptableObject
put
in interface Scriptable
put
in class ScriptableObject
index
- 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)
ScriptableObject
delete
in interface Scriptable
delete
in class ScriptableObject
index
- the numeric index for the propertyScriptable.get(int, Scriptable)
,
ScriptableObject.deleteProperty(Scriptable, int)
public Object[] getIds()
ScriptableObject
Any properties with the attribute DONTENUM are not listed.
getIds
in interface Scriptable
getIds
in class ScriptableObject
public Object[] getAllIds()
ScriptableObject
All properties, even those with attribute DONTENUM, are listed.
getAllIds
in interface DebuggableObject
getAllIds
in class ScriptableObject
public Integer[] getIndexIds()
public Object getDefaultValue(Class<?> hint)
ScriptableObject
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".
getDefaultValue
in interface Scriptable
getDefaultValue
in class ScriptableObject
hint
- the type hintprotected ScriptableObject getOwnPropertyDescriptor(Context cx, Object id)
getOwnPropertyDescriptor
in class IdScriptableObject
public void defineOwnProperty(Context cx, Object id, ScriptableObject desc)
ScriptableObject
defineOwnProperty
in class IdScriptableObject
cx
- the current Contextid
- the name/index of the propertydesc
- the new property descriptor, as described in 8.6.1public long getLength()
public long jsGet_length()
getLength()
instead.public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
public int size()
size
in interface Collection
size
in interface List
size
in class ScriptableObject
public Object get(long index)
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public Iterator iterator()
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int start)
listIterator
in interface List
public boolean add(Object o)
add
in interface Collection
add
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public void clear()
clear
in interface Collection
clear
in interface List
public boolean addAll(int index, Collection c)
protected int findPrototypeId(String s)
findPrototypeId
in class IdScriptableObject