vrml.eai.field
Class EventOutMFTime

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

public abstract class EventOutMFTime
extends EventOutMField

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

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

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
 double[] t = timestamps_changed.getValue();
 for (int i = 0; i < t.length; ++i)
     System.out.println(new java.util.Date((long)(t[i] * 1000.0)));
 


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 EventOutMFTime()
          Default Constructor.
 
Method Summary
abstract  double get1Value(int index)
          Returns one element of a MFTime event-out slot.
abstract  double[] getValue()
          Returns the current value of a MFTime event-out slot.
abstract  void getValue(double[] value)
          Returns the current value of a MFTime 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

EventOutMFTime

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

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

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
 double[] t = timestamps_changed.getValue();
 for (int i = 0; i < t.length; ++i)
     System.out.println(new java.util.Date((long)(t[i] * 1000.0)));
 

Returns:
The current time values. This is an array of double values containing the number of seconds since January the 1st, 1970, 00:00:00 GMT.

getValue

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

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

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
 int size = timestamps_changed.size();
 double[] t = new double[size];
 timestamps_changed.getValue(t);
 for (int i = 0; i < size; ++i)
     System.out.println(new java.util.Date((long)(t[i] * 1000.0)));
 

Parameters:
value - An array of double values that gets filled with the current time values of the MFTime event-out slot. The double values contain the number of seconds since January the 1st, 1970, 00:00:00 GMT.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the value array is too small.

get1Value

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

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

 vrml.eai.Node script = ...;
 vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
 System.out.println(new java.util.Date((long)(timestamps_changed.get1Value(0) * 1000.0)));
 

Parameters:
index - The index of the element, starting at 0.
Returns:
The time value. This is a double value containing the number of seconds since January the 1st, 1970, 00:00:00 GMT.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid.