Interface MFString
Strings are represented using standard java.lang.String representations. The implementation of this class will provide any necessary conversions to the UTF8 format required for VRML support.
- 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 string value in the given eventOut array.void
Write the value of the array of the strings to the given array.void
insertValue
(int index, String 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 string value in the given eventIn array.void
Set the value of the array of strings.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 strings to the given array. Individual elements in the string array may be null depending on the implementation of the browser and whether it maintains null references.- Parameters:
value
- The string array to be filled in- Throws:
ArrayIndexOutOfBoundsException
- The provided array was too small
-
get1Value
Get a particular string 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 array reference was null when set, an empty string will be returned to the caller.
- Parameters:
index
- The position to get the string value from- Returns:
- The string value
- Throws:
ArrayIndexOutOfBoundsException
- The index value was out of bounds of the current array.
-
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 strings. If value[i] contains a null reference this will not cause an exception to be generated. However, the resulting event that the eventIn receives will be implementation specific as this is not dealt with in the VRML specification.- Parameters:
numStrings
- The number of items to be copied from this arrayvalue
- The array of strings.
-
set1Value
Set a particular string value in the given eventIn array. To the VRML world this will generate a full MFString 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 value reference is null then the result is implementation specific in terms of the array reference that reaches the eventIn. In any case, an event will reach the destination eventIn, but the values in that array are implementation specific. No exception will be generated in this case.
- Parameters:
index
- The position to set the string valuevalue
- The string value- Throws:
ArrayIndexOutOfBoundsException
- The index value was out of bounds of the current array.
-