FileDocCategorySizeDatePackage
Time.javaAPI DocJMF 2.1.1e1608Mon May 12 12:20:36 BST 2003javax.media

Time

public class Time extends Object implements Serializable
Time is kept at nanosecond precision.

This is the JMF 1.0 Time interface.

version
1.6 98/06/23

Fields Summary
public static final long
ONE_SECOND
public static final Time
TIME_UNKNOWN
private static final double
NANO_TO_SEC
protected long
nanoseconds
Time in nanoseconds.
Constructors Summary
public Time(long nanoseconds)
Constructs a Time using nanoseconds.

param
nano Number of nanoseconds for this time.


                      
       

	this.nanoseconds = nanoseconds;
    
public Time(double seconds)
Constructs a Time using seconds.

param
seconds Time specified in seconds.


	nanoseconds = secondsToNanoseconds(seconds);
    
Methods Summary
public longgetNanoseconds()
Gets the time value in nanoseconds.

return
time value in nanoseconds.


	return nanoseconds;
    
public doublegetSeconds()
Gets the time value in seconds.

return
time value in seconds.


	return nanoseconds * NANO_TO_SEC;
    
protected longsecondsToNanoseconds(double seconds)
Converts seconds to nanoseconds.


	return (long)(seconds * ONE_SECOND);