Class MFDouble
java.lang.Object
org.web3d.vrml.scripting.ecmascript.builtin.FieldScriptableObject
org.web3d.vrml.scripting.ecmascript.builtin.MFDouble
- All Implemented Interfaces:
org.mozilla.javascript.Scriptable
MFDouble field object.
- Version:
- $Revision: 1.5 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.scripting.ecmascript.builtin.FieldScriptableObject
BAD_FORMAT_MSG, dataChanged, INVALID_TYPE_MSG, readOnly, READONLY_MSG, scriptField
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorsConstructorDescriptionMFDouble()
Default public constructor required by Rhino for when created by an Ecmascript call.MFDouble
(double[] values, int numValid) Construct a field based on the given array of data (sourced from a node).MFDouble
(float[] values, int numValid) Construct a field based on the given array of data (sourced from a node).Construct a field based on an array of SFDouble objects. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares two objects for equality base on the components being the same.get
(int index, org.mozilla.javascript.Scriptable start) Get the value at the given index.Get the value of the named function.double[]
Get the array of underlying double values.void
getRawData
(double[] value) Alternative form to fetch the raw value by copying it into the provided array.void
getRawData
(float[] value) Alternative form to fetch the raw value by copying it into the provided array.boolean
has
(int index, org.mozilla.javascript.Scriptable start) Check for the indexed property presence.boolean
Check for the named property presence.static org.mozilla.javascript.Scriptable
jsConstructor
(org.mozilla.javascript.Context cx, Object[] args, org.mozilla.javascript.Function ctorObj, boolean inNewExpr) Constructor for a new Rhino objectboolean
jsFunction_equals
(Object val) Comparison of this object to another of the same type.Creates a string version of this node.void
Sets a property based on the index.void
Sets the named property with a new value.toString()
Format the internal values of this field as a string.void
updateRawData
(double[] values, int numValid) Update the node's raw data from the underlying model.Methods inherited from class org.web3d.vrml.scripting.ecmascript.builtin.FieldScriptableObject
delete, delete, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, hasChanged, hasInstance, locateFunction, registerFunction, setParentScope, setPrototype, setReadOnly, setScriptField
-
Constructor Details
-
MFDouble
public MFDouble()Default public constructor required by Rhino for when created by an Ecmascript call. -
MFDouble
public MFDouble(float[] values, int numValid) Construct a field based on the given array of data (sourced from a node).- Parameters:
values
- array of initial valuesnumValid
- The number of valid values to copy from the array
-
MFDouble
public MFDouble(double[] values, int numValid) Construct a field based on the given array of data (sourced from a node).- Parameters:
values
- array of initial valuesnumValid
- The number of valid values to copy from the array
-
MFDouble
Construct a field based on an array of SFDouble objects.- Parameters:
args
- the objects
-
-
Method Details
-
jsConstructor
public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx, Object[] args, org.mozilla.javascript.Function ctorObj, boolean inNewExpr) Constructor for a new Rhino object- Returns:
- MFDouble result
-
has
public boolean has(int index, org.mozilla.javascript.Scriptable start) Check for the indexed property presence.- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classFieldScriptableObject
- Returns:
- whether indexed property index is nonnegative (TODO check)
-
has
Check for the named property presence.- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classFieldScriptableObject
- Parameters:
start
-- Returns:
- true if it is a defined eventOut or field
-
get
Get the value at the given index.- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classFieldScriptableObject
- Parameters:
index
- The position of the value to readstart
- The object where the lookup began- Returns:
- the corresponding value
-
get
Get the value of the named function. If no function object is registered for this name, the method will return null.- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classFieldScriptableObject
- Parameters:
name
- The variable namestart
- The object where the lookup began- Returns:
- the corresponding function object or null
-
put
Sets a property based on the index. According to C.6.15.1 if the index is greater than the current number of nodes, expand the size by one and add the new value to the end.- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classFieldScriptableObject
- Parameters:
index
- The index of the property to setstart
- The object who's property is being setvalue
- The value being requested
-
put
Sets the named property with a new value. We don't allow the users to dynamically change the length property of this node. That would cause all sorts of problems. Therefore it is read-only as far as this implementation is concerned.- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classFieldScriptableObject
- Parameters:
name
- The name of the property to definestart
- The object who's property is being setvalue
- The value being requested
-
jsFunction_toString
Creates a string version of this node. Just calls the standard toString() method of the object.- Returns:
- A VRML string representation of the field
-
jsFunction_equals
Comparison of this object to another of the same type. Just calls the standard equals() method of the object.- Parameters:
val
- The value to compare to this object- Returns:
- true if the components of the object are the same
-
toString
-
equals
-
updateRawData
public void updateRawData(double[] values, int numValid) Update the node's raw data from the underlying model. If this wrapper has a local changed copy of the data that has not yet been committed to the underlying model, this request is ignored and the current data stays.- Parameters:
values
- The list of values to update herenumValid
- The number of valid values to copy from the array The number of valid values to use from the array
-
getRawData
public double[] getRawData()Get the array of underlying double values.- Returns:
- An array of the values
-
getRawData
public void getRawData(float[] value) Alternative form to fetch the raw value by copying it into the provided array.- Parameters:
value
- The array to copy the data into
-
getRawData
public void getRawData(double[] value) Alternative form to fetch the raw value by copying it into the provided array.- Parameters:
value
- The array to copy the data into
-