|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.NativeArray
public class NativeArray
This class implements the Array native object.
Field Summary |
---|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
NativeArray(long lengthArg)
|
|
NativeArray(java.lang.Object[] array)
|
Method Summary | |
---|---|
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,
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. |
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. |
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined. |
protected void |
initPrototypeId(int id)
|
long |
jsGet_length()
Deprecated. Use getLength() instead. |
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. |
protected void |
setInstanceIdValue(int id,
java.lang.Object value)
Set or delete id value. |
Methods inherited from class org.mozilla.javascript.IdScriptableObject |
---|
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, setAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NativeArray(long lengthArg)
public NativeArray(java.lang.Object[] array)
Method Detail |
---|
public java.lang.String getClassName()
ScriptableObject
getClassName
in interface Scriptable
getClassName
in class ScriptableObject
protected int getMaxInstanceId()
IdScriptableObject
getMaxInstanceId
in class IdScriptableObject
protected int findInstanceIdInfo(java.lang.String s)
IdScriptableObject
IdScriptableObject.instanceIdInfo(int, int)
.
findInstanceIdInfo
in class IdScriptableObject
protected java.lang.String getInstanceIdName(int id)
IdScriptableObject
getInstanceIdName
in class IdScriptableObject
protected java.lang.Object getInstanceIdValue(int id)
IdScriptableObject
getInstanceIdValue
in class IdScriptableObject
protected void setInstanceIdValue(int id, java.lang.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 java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
IdScriptableObject
execIdCall
in interface IdFunctionCall
execIdCall
in class IdScriptableObject
public java.lang.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 began
Scriptable.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 began
Scriptable.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
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, java.lang.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 java.lang.Object[] getIds()
ScriptableObject
Any properties with the attribute DONTENUM are not listed.
getIds
in interface Scriptable
getIds
in class 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 interface Scriptable
getDefaultValue
in class ScriptableObject
hint
- the type hint
public long getLength()
public long jsGet_length()
getLength()
instead.
protected int findPrototypeId(java.lang.String s)
findPrototypeId
in class IdScriptableObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |