public class NativeArray extends IdScriptableObject implements java.util.List
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
构造器和说明 |
---|
NativeArray(long lengthArg) |
NativeArray(java.lang.Object[] array) |
限定符和类型 | 方法和说明 |
---|---|
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) |
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) |
java.lang.Object[] |
getAllIds()
Returns an array of ids for the properties of the object.
|
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()
Returns an array of ids for the properties of the object.
|
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) |
java.util.Iterator |
iterator() |
long |
jsGet_length()
已过时。
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, defaultPut, defineOwnProperty, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, setAttributes
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, getArrayPrototype, getAssociatedValue, 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, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
public NativeArray(long lengthArg)
public NativeArray(java.lang.Object[] array)
public java.lang.String getClassName()
ScriptableObject
getClassName
在接口中 Scriptable
getClassName
在类中 ScriptableObject
protected int getMaxInstanceId()
IdScriptableObject
getMaxInstanceId
在类中 IdScriptableObject
protected void setInstanceIdAttributes(int id, int attr)
IdScriptableObject
setInstanceIdAttributes
在类中 IdScriptableObject
id
- the instance property idattr
- the new attribute bitsetprotected int findInstanceIdInfo(java.lang.String s)
IdScriptableObject
IdScriptableObject.instanceIdInfo(int, int)
.findInstanceIdInfo
在类中 IdScriptableObject
protected java.lang.String getInstanceIdName(int id)
IdScriptableObject
getInstanceIdName
在类中 IdScriptableObject
protected java.lang.Object getInstanceIdValue(int id)
IdScriptableObject
getInstanceIdValue
在类中 IdScriptableObject
protected void setInstanceIdValue(int id, java.lang.Object value)
IdScriptableObject
setInstanceIdValue
在类中 IdScriptableObject
protected void fillConstructorProperties(IdFunctionObject ctor)
protected void initPrototypeId(int id)
initPrototypeId
在类中 IdScriptableObject
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
IdScriptableObject
execIdCall
在接口中 IdFunctionCall
execIdCall
在类中 IdScriptableObject
public java.lang.Object get(int index, Scriptable start)
ScriptableObject
get
在接口中 Scriptable
get
在类中 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
在接口中 Scriptable
has
在类中 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(java.lang.String id, Scriptable start, java.lang.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
在接口中 Scriptable
put
在类中 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, java.lang.Object value)
ScriptableObject
put
在接口中 Scriptable
put
在类中 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
在接口中 Scriptable
delete
在类中 ScriptableObject
index
- the numeric index for the propertyScriptable.get(int, Scriptable)
,
ScriptableObject.deleteProperty(Scriptable, int)
public java.lang.Object[] getIds()
ScriptableObject
Any properties with the attribute DONTENUM are not listed.
getIds
在接口中 Scriptable
getIds
在类中 ScriptableObject
public java.lang.Object[] getAllIds()
ScriptableObject
All properties, even those with attribute DONTENUM, are listed.
getAllIds
在接口中 DebuggableObject
getAllIds
在类中 ScriptableObject
public java.lang.Integer[] getIndexIds()
public java.lang.Object getDefaultValue(java.lang.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
在接口中 Scriptable
getDefaultValue
在类中 ScriptableObject
hint
- the type hintpublic int getAttributes(int index)
ScriptableObject
getAttributes
在类中 ScriptableObject
index
- the numeric index for the propertyScriptableObject.has(String, Scriptable)
,
ScriptableObject.READONLY
,
ScriptableObject.DONTENUM
,
ScriptableObject.PERMANENT
,
ScriptableObject.EMPTY
protected ScriptableObject getOwnPropertyDescriptor(Context cx, java.lang.Object id)
protected void defineOwnProperty(Context cx, java.lang.Object id, ScriptableObject desc, boolean checkValid)
ScriptableObject
defineOwnProperty
在类中 ScriptableObject
cx
- 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()
public long jsGet_length()
getLength()
instead.public boolean contains(java.lang.Object o)
contains
在接口中 java.util.Collection
contains
在接口中 java.util.List
public java.lang.Object[] toArray()
toArray
在接口中 java.util.Collection
toArray
在接口中 java.util.List
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
在接口中 java.util.Collection
toArray
在接口中 java.util.List
public boolean containsAll(java.util.Collection c)
containsAll
在接口中 java.util.Collection
containsAll
在接口中 java.util.List
public int size()
size
在接口中 java.util.Collection
size
在接口中 java.util.List
size
在类中 ScriptableObject
public java.lang.Object get(long index)
public java.lang.Object get(int index)
get
在接口中 java.util.List
public int indexOf(java.lang.Object o)
indexOf
在接口中 java.util.List
public int lastIndexOf(java.lang.Object o)
lastIndexOf
在接口中 java.util.List
public java.util.Iterator iterator()
iterator
在接口中 java.lang.Iterable
iterator
在接口中 java.util.Collection
iterator
在接口中 java.util.List
public java.util.ListIterator listIterator()
listIterator
在接口中 java.util.List
public java.util.ListIterator listIterator(int start)
listIterator
在接口中 java.util.List
public boolean add(java.lang.Object o)
add
在接口中 java.util.Collection
add
在接口中 java.util.List
public boolean remove(java.lang.Object o)
remove
在接口中 java.util.Collection
remove
在接口中 java.util.List
public boolean addAll(java.util.Collection c)
addAll
在接口中 java.util.Collection
addAll
在接口中 java.util.List
public boolean removeAll(java.util.Collection c)
removeAll
在接口中 java.util.Collection
removeAll
在接口中 java.util.List
public boolean retainAll(java.util.Collection c)
retainAll
在接口中 java.util.Collection
retainAll
在接口中 java.util.List
public void clear()
clear
在接口中 java.util.Collection
clear
在接口中 java.util.List
public void add(int index, java.lang.Object element)
add
在接口中 java.util.List
public boolean addAll(int index, java.util.Collection c)
addAll
在接口中 java.util.List
public java.lang.Object set(int index, java.lang.Object element)
set
在接口中 java.util.List
public java.lang.Object remove(int index)
remove
在接口中 java.util.List
public java.util.List subList(int fromIndex, int toIndex)
subList
在接口中 java.util.List
protected int findPrototypeId(java.lang.String s)
findPrototypeId
在类中 IdScriptableObject