Xj3D 2.0 VRML/X3D Code API

org.web3d.x3d.sai
Interface MFFloat

All Superinterfaces:
MField, X3DField

public interface MFFloat
extends MField

Representation of a MFFloat field.

Version:
1.0 30 April 1998

Method Summary
 void append(float value)
          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.
 float get1Value(int index)
          Get the value of an individual item in the eventOut's value.
 void getValue(float[] values)
          Write the value of the array of the floats to the given array.
 void insertValue(int index, float value)
          Inserts a value into an existing index of the field.
 void removeValue(int index)
          Removes one value from the field.
 void set1Value(int index, float value)
          Set the value of an individual item in the eventIn's value.
 void setValue(int size, float[] value)
          Set the value of the eventIn to the new array of float values.
 
Methods inherited from interface org.web3d.x3d.sai.MField
getSize
 
Methods inherited from interface org.web3d.x3d.sai.X3DField
addX3DEventListener, getDefinition, getUserData, isReadable, isWritable, removeX3DEventListener, setUserData
 

Method Detail

append

void append(float value)
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

void getValue(float[] values)
Write the value of the array of the floats to the given array.

Parameters:
values - The array to be filled in
Throws:
java.lang.ArrayIndexOutOfBoundsException - The provided array was too small

get1Value

float get1Value(int index)
                throws java.lang.ArrayIndexOutOfBoundsException
Get the value of an individual item in the eventOut's value. If the index is out of the bounds of the current array of data values an ArrayIndexOutOfBoundsException will be generated.

Parameters:
index - The position to be retrieved
Returns:
The value to at that position
Throws:
java.lang.ArrayIndexOutOfBoundsException - The index was outside the current data array bounds.

insertValue

void insertValue(int index,
                 float value)
                 throws java.lang.ArrayIndexOutOfBoundsException
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 accomodate 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 insert
value - The new element to insert
Throws:
java.lang.ArrayIndexOutOfBoundsException - The index was outside the current field size.

removeValue

void removeValue(int index)
                 throws java.lang.ArrayIndexOutOfBoundsException
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:
java.lang.ArrayIndexOutOfBoundsException - The index was outside the current field size.

setValue

void setValue(int size,
              float[] value)
Set the value of the eventIn to the new array of float values. This array is copied internally so that the parameter array can be reused without effecting the valid values of the eventIn.

Parameters:
size - The number of items to copy from the array
value - The array of values to be used.

set1Value

void set1Value(int index,
               float value)
               throws java.lang.ArrayIndexOutOfBoundsException
Set the value of an individual item in the eventIn's value. This results in a new event being generated that includes all of the array items with the single element set. If the index is out of the bounds of the current array of data values an ArrayIndexOutOfBoundsException will be generated.

Parameters:
index - The position to set the float value
value - The value to be set
Throws:
java.lang.ArrayIndexOutOfBoundsException - A value did not contain at least three values for the colour component

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium