Interface MFNode
Get the values of a node array. The java null
reference is
treated to be equivalent to the VRML NULL
field values.
It is not illegal to construct an array where some members of the array are null pointers. Due to no specification on the intended result in the VRML specification, the response given by the browser is implementation dependent. Calls will not generate an exception, but the value of actual event received from the scene graph may vary until the issue is resolved.
- Version:
- 1.0 30 April 1998
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Places a new value at the end of the existing value, increasing the field length accordingly.void
clear()
Removes all values in the field and changes the field size to zero.get1Value
(int index) Get a particular node value in the given eventOut array.void
Write the value of the array of the nodes to the given array.void
insertValue
(int index, X3DNode value) Inserts a value into an existing index of the field.void
removeValue
(int index) Removes one value from the field.void
Set a particular node value in the given eventIn array.void
Set the value of the array of nodes.Methods inherited from interface org.web3d.x3d.sai.X3DField
addX3DEventListener, getDefinition, getUserData, isReadable, isWritable, removeX3DEventListener, setUserData
-
Method Details
-
append
Places a new value at the end of the existing value, increasing the field length accordingly.- Parameters:
value
- The value to append
-
clear
void clear()Removes all values in the field and changes the field size to zero. -
getValue
Write the value of the array of the nodes to the given array. Individual elements in the array may be null depending on the implementation of the browser and whether it maintains null references.- Parameters:
nodes
- The node array to be filled in- Throws:
ArrayIndexOutOfBoundsException
- The provided array was too small
-
get1Value
Get a particular node value in the given eventOut array.If the index is out of the bounds of the current array of data values an ArrayIndexOutOfBoundsException will be generated. If the Node value is NULL because the browser implementation keeps null references then this method will return a null pointer without throwing any exception.
- Parameters:
index
- The position to read the values from- Returns:
- The node reference
- Throws:
ArrayIndexOutOfBoundsException
- The index was outside the current data array bounds.
-
insertValue
Inserts a value into an existing index of the field. Current field values from the index to the end of the field are shifted down and the field length is increased by one to accommodate the new element. If the index is out of the bounds of the current field an ArrayIndexOutofBoundsException will be generated.- Parameters:
index
- The position at which to insertvalue
- The new element to insert- Throws:
ArrayIndexOutOfBoundsException
- The index was outside the current field size.
-
removeValue
Removes one value from the field. Values at indices above the removed element will be shifted down by one and the size of the field will be reduced by one.- Parameters:
index
- The position of the value to remove.- Throws:
ArrayIndexOutOfBoundsException
- The index was outside the current field size.
-
setValue
Set the value of the array of nodes. Input is an array of valid Node references. If the length is zero or the node reference is null, then the actions to take are according to the class introduction above. If the array contains a null reference then th resulting event passed to the eventIn is implementation dependentIf any of the node references have had their dispose methods called, an InvalidNodeException will be generated and no event sent to the scene graph.
- Parameters:
size
- The number of nodes to copy from this arrayvalue
- The array of node references- Throws:
InvalidNodeException
- At least one node has been "disposed" of
-
set1Value
Set a particular node value in the given eventIn array. To the VRML world this will generate a full MFNode event with the nominated index value changed.If the index is out of the bounds of the current array of data values an ArrayIndexOutOfBoundsException will be generated. If the Node value is null the behaviour will be undefined as far as generating an event to the scene graph is concerned in order to be consistent with the behaviour described in the class introduction. This method call will not generate an exception if the node reference is null.
If the node reference passed to this method has already had the dispose method called then an InvalidNodeException will be generated.
- Parameters:
index
- The position to set the colour valuevalue
- The node reference- Throws:
InvalidNodeException
- The node has been "disposed" ofArrayIndexOutOfBoundsException
- The index was out of bounds of the array currently.
-