vrml.eai.field
Class EventOutMFFloat

java.lang.Object
  extended by vrml.eai.field.BaseField
      extended by vrml.eai.field.EventOut
          extended by vrml.eai.field.EventOutMField
              extended by vrml.eai.field.EventOutMFFloat

public abstract class EventOutMFFloat
extends EventOutMField

Reference to a MFFloat event-out slot. Use this class to read values from MFFloat event-out slots.

The following example gets the keys from the "key" field of a CoordinateInterpolator node and prints them to the console:

 vrml.eai.Node coordinateInterpolator = ...;
 vrml.eai.field.EventOutMFFloat key_changed = (vrml.eai.field.EventOutMFFloat)coordinateInterpolator.getEventOut("key_changed");
 float[] f = key_changed.getValue();
 for (int i = 0; i < f.length; ++i)
     System.out.println(f[i]);
 


Field Summary
 
Fields inherited from class vrml.eai.field.BaseField
MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f
 
Constructor Summary
protected EventOutMFFloat()
          Default Constructor.
 
Method Summary
abstract  float get1Value(int index)
          Returns one element of a MFFloat event-out slot.
abstract  float[] getValue()
          Returns the current value of a MFFloat event-out slot.
abstract  void getValue(float[] value)
          Returns the current value of a MFFloat event-out slot.
 
Methods inherited from class vrml.eai.field.EventOutMField
size
 
Methods inherited from class vrml.eai.field.EventOut
addVrmlEventListener, getUserData, removeVrmlEventListener, setUserData
 
Methods inherited from class vrml.eai.field.BaseField
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventOutMFFloat

protected EventOutMFFloat()
Default Constructor. This method is protected, i.e. you cannot create new instances of this class. The only way to get instances is via the Node.getEventOut(java.lang.String) method.

Method Detail

getValue

public abstract float[] getValue()
Returns the current value of a MFFloat event-out slot.

The following example gets the keys from the "key" field of a CoordinateInterpolator node and prints them to the console:

 vrml.eai.Node coordinateInterpolator = ...;
 vrml.eai.field.EventOutMFFloat key_changed = (vrml.eai.field.EventOutMFFloat)coordinateInterpolator.getEventOut("key_changed");
 float[] f = key_changed.getValue();
 for (int i = 0; i < f.length; ++i)
     System.out.println(f[i]);
 

Returns:
The current float values.

getValue

public abstract void getValue(float[] value)
                       throws java.lang.ArrayIndexOutOfBoundsException
Returns the current value of a MFFloat event-out slot.

The following example gets the keys from the "key" field of a CoordinateInterpolator node and prints them to the console:

 vrml.eai.Node coordinateInterpolator = ...;
 vrml.eai.field.EventOutMFFloat key_changed = (vrml.eai.field.EventOutMFFloat)coordinateInterpolator.getEventOut("key_changed");
 int size = key_changed.size();
 float[] f = new float[size];
 key_changed.getValue(f);
 for (int i = 0; i < size; ++i)
     System.out.println(f[i]);
 

Parameters:
value - An array of float values that gets filled with the current value of the MFFloat event-out slot.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the value array is too small.

get1Value

public abstract float get1Value(int index)
                         throws java.lang.ArrayIndexOutOfBoundsException
Returns one element of a MFFloat event-out slot.

The following example gets the first key from the "key" field of a CoordinateInterpolator node and prints it to the console:

 vrml.eai.Node coordinateInterpolator = ...;
 vrml.eai.field.EventOutMFFloat key_changed = (vrml.eai.field.EventOutMFFloat)coordinateInterpolator.getEventOut("key_changed");
 System.out.println(key_changed.get1Value(0));
 

Parameters:
index - The index of the element, starting at 0.
Returns:
The float value.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid.