vrml.eai.field
Class EventOutSFTime
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventOut
vrml.eai.field.EventOutSFTime
public abstract class EventOutSFTime
- extends EventOut
Reference to a SFTime event-out slot. Use this class to read
values from SFTime event-out slots.
The following example demonstrates how to get the current
time stamp from a TimeSensor node:
vrml.eai.Node timeSensor = ...;
vrml.eai.field.EventOutSFTime time = (vrml.eai.field.EventOutSFTime)timeSensor.getEventOut("time");
java.util.Date date = new java.util.Date((long)(time.getValue() * 1000.0));
System.out.println("Time = " + date);
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 |
Method Summary |
abstract double |
getValue()
Returns the current value of the SFTime event-out slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventOutSFTime
protected EventOutSFTime()
- 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.
getValue
public abstract double getValue()
- Returns the current value of the SFTime event-out slot.
The following example demonstrates how to get the current
time stamp from a TimeSensor node:
vrml.eai.Node timeSensor = ...;
vrml.eai.field.EventOutSFTime time = (vrml.eai.field.EventOutSFTime)timeSensor.getEventOut("time");
java.util.Date date = new java.util.Date((long)(time.getValue() * 1000.0));
System.out.println("Time = " + date);
- Returns:
- The time value. This is a double value containing the
number of seconds since January the 1st, 1970, 00:00:00 GMT.