vrml.eai.field
Class EventOutMFString

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

public abstract class EventOutMFString
extends EventOutMField

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

The following example gets the lines from the "string" field of a Text node and prints them to the console:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventOutMFString string_changed = (vrml.eai.field.EventOutMFString)text.getEventOut("string_changed");
 String[] s = string_changed.getValue();
 for (int i = 0; i < s.length; ++i)
     System.out.println(s[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 EventOutMFString()
          Default Constructor.
 
Method Summary
abstract  java.lang.String get1Value(int index)
          Returns one element of a MFString event-out slot.
abstract  java.lang.String[] getValue()
          Returns the current value of a MFString event-out slot.
abstract  void getValue(java.lang.String[] value)
          Returns the current value of a MFString 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

EventOutMFString

protected EventOutMFString()
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 java.lang.String[] getValue()
Returns the current value of a MFString event-out slot.

The following example gets the lines from the "string" field of a Text node and prints them to the console:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventOutMFString string_changed = (vrml.eai.field.EventOutMFString)text.getEventOut("string_changed");
 String[] s = string_changed.getValue();
 for (int i = 0; i < s.length; ++i)
     System.out.println(s[i]);
 

Returns:
The current string values.

getValue

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

The following example gets the lines from the "string" field of a Text node and prints them to the console:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventOutMFString string_changed = (vrml.eai.field.EventOutMFString)text.getEventOut("string_changed");
 int size = string_changed.size();
 String[] s = new String[size];
 string_changed.getValue(s);
 for (int i = 0; i < size; ++i)
     System.out.println(s[i]);
 

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

get1Value

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

The following example gets the first line from the "string" field of a Text node and prints it to the console:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventOutMFString string_changed = (vrml.eai.field.EventOutMFString)text.getEventOut("string_changed");
 System.out.println(string_changed.get1Value(0));
 

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