|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mozilla.javascript.ScriptableObject | +--org.mozilla.javascript.IdScriptable | +--org.mozilla.javascript.NativeArray
This class implements the Array native object.
Fields inherited from class org.mozilla.javascript.ScriptableObject |
DONTENUM, EMPTY, PERMANENT, READONLY |
Fields inherited from interface org.mozilla.javascript.Scriptable |
NOT_FOUND |
Constructor Summary | |
NativeArray()
Zero-parameter constructor: just used to create Array.prototype |
|
NativeArray(long length)
|
|
NativeArray(java.lang.Object[] array)
|
Method Summary | |
void |
delete(int index)
Removes the indexed property from the object. |
java.lang.Object |
execMethod(int methodId,
IdFunction 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. |
java.lang.Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND. |
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. |
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined. |
static void |
init(Context cx,
Scriptable scope,
boolean sealed)
|
long |
jsGet_length()
|
int |
methodArity(int methodId)
Get arity or defined argument count for method with given id. |
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. |
Methods inherited from class org.mozilla.javascript.IdScriptable |
addAsPrototype, defineProperty, delete, get, getAttributes, has, setAttributes |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, getAllIds, getAttributes, getClassPrototype, getFunctionPrototype, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, hasInstance, hasProperty, hasProperty, isSealed, putProperty, putProperty, sealObject, setAttributes, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NativeArray()
public NativeArray(long length)
public NativeArray(java.lang.Object[] array)
Method Detail |
public static void init(Context cx, Scriptable scope, boolean sealed)
public java.lang.String getClassName()
ScriptableObject
getClassName
in class ScriptableObject
public int methodArity(int methodId)
IdScriptable
methodArity
in class IdScriptable
public java.lang.Object execMethod(int methodId, IdFunction f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args) throws JavaScriptException
IdScriptable
execMethod
in class IdScriptable
public java.lang.Object get(int index, Scriptable start)
ScriptableObject
get
in class ScriptableObject
org.mozilla.javascript.ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup beganpublic boolean has(int index, Scriptable start)
ScriptableObject
has
in class ScriptableObject
org.mozilla.javascript.ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup beganpublic 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
in class IdScriptable
org.mozilla.javascript.ScriptableObject
name
- the name of the propertystart
- the object whose property is being setvalue
- value to set the property topublic void put(int index, Scriptable start, java.lang.Object value)
ScriptableObject
put
in class ScriptableObject
org.mozilla.javascript.ScriptableObject
index
- the numeric index for the propertystart
- the object whose property is being setvalue
- value to set the property topublic void delete(int index)
ScriptableObject
delete
in class ScriptableObject
org.mozilla.javascript.ScriptableObject
index
- the numeric index for the propertypublic java.lang.Object[] getIds()
ScriptableObject
Any properties with the attribute DONTENUM are not listed.
getIds
in class ScriptableObject
org.mozilla.javascript.ScriptableObject
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
in class ScriptableObject
org.mozilla.javascript.ScriptableObject
typeHint
- the type hintpublic long jsGet_length()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |