Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

JSR-927 (Maintenance Release)

javax.media
Class Time

java.lang.Object
  extended byjavax.media.Time

public class Time
extends java.lang.Object

Time abstracts time in the Java Media framework.

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.


JSR-927 (Maintenance Release)

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 927 specification.