vrml.eai.field
Class EventOutMFInt32

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.EventOutMFInt32

public abstract class EventOutMFInt32
extends EventOutMField

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

The following example gets the values of an "index_changed" event-out slot of a Script node and prints them to the console:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFInt32 index_changed = (vrml.eai.field.EventOutMFInt32)script.getEventOut("index_changed");
 int[] v = index_changed.getValue();
 for (int i = 0; i < v.length; ++i)
     System.out.println(v[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 EventOutMFInt32()
          Default Constructor.
 
Method Summary
abstract  int get1Value(int index)
          Returns one element of a MFFloat event-out slot.
abstract  int[] getValue()
          Returns the current value of a MFInt32 event-out slot.
abstract  void getValue(int[] value)
          Returns the current value of a MFInt32 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

EventOutMFInt32

protected EventOutMFInt32()
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 int[] getValue()
Returns the current value of a MFInt32 event-out slot.

The following example gets the values of an "index_changed" event-out slot of a Script node and prints them to the console:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFInt32 index_changed = (vrml.eai.field.EventOutMFInt32)script.getEventOut("index_changed");
 int[] v = index_changed.getValue();
 for (int i = 0; i < v.length; ++i)
     System.out.println(v[i]);
 

Returns:
The current integer values.

getValue

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

The following example gets the values of an "index_changed" event-out slot of a Script node and prints them to the console:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFInt32 index_changed = (vrml.eai.field.EventOutMFInt32)script.getEventOut("index_changed");
 int size = index_changed.size();
 int[] v = new int[size];
 index_changed.getValue(v);
 for (int i = 0; i < size; ++i)
     System.out.println(v[i]);
 

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

get1Value

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

The following example gets the first value of an "index_changed" event-out slot of a Script node and prints it to the console:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFInt32 index_changed = (vrml.eai.field.EventOutMFInt32)script.getEventOut("index_changed");
 System.out.println(index_changed.get1Value(0));
 

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