javax.media
Class Time

java.lang.Object
  extended by javax.media.Time

public class Time
extends Object

Time abstracts time in the Java Media framework.

Version:
1.10, 97/08/28.
See Also:
Clock, TimeBase

Field Summary
protected  long nanoseconds
          Time is kept to a granularity of nanoseconds.
static long ONE_SECOND
           
 
Constructor Summary
Time(double seconds)
          Construct a time in seconds.
Time(long nano)
          Construct a time in nanoseconds.
 
Method Summary
 long getNanoseconds()
          Get the time value in nanoseconds.
 double getSeconds()
          Get the time value in seconds.
protected  long secondsToNanoseconds(double seconds)
          Convert seconds to nanoseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE_SECOND

public static final long ONE_SECOND
See Also:
Constant Field Values

nanoseconds

protected long nanoseconds
Time is kept to a granularity of nanoseconds. Converions to and from this value are done to implement construction or query in seconds.

Constructor Detail

Time

public Time(long nano)
Construct a time in nanoseconds.

Parameters:
nano - Number of nanoseconds for this time.

Time

public Time(double seconds)
Construct a time in seconds.

Parameters:
seconds - Time specified in seconds.
Method Detail

secondsToNanoseconds

protected long secondsToNanoseconds(double seconds)
Convert seconds to nanoseconds.


getNanoseconds

public long getNanoseconds()
Get the time value in nanoseconds.

Returns:
The time in nanoseconds.

getSeconds

public double getSeconds()
Get the time value in seconds.



Copyright © 2011. All Rights Reserved.