org.catacombae.jfuse.types.system
Class Timespec

java.lang.Object
  extended by org.catacombae.jfuse.types.system.Timespec

public class Timespec
extends Object

A Java mapping of struct timespec.

Author:
Erik Larsson

Field Summary
 int nsec
          Nanoseconds.
 int sec
          Seconds.
 
Constructor Summary
Timespec()
           
 
Method Summary
 void print(String prefix, PrintStream ps)
           
 void printFields(String prefix, PrintStream ps)
           
 void setToDate(Date d)
          Sets the fields of this Timespec object to the specified time value, expressed as a Java date.
 void setToMillis(long millis)
          Sets the fields of this Timespec object to the specified time value, expressed in milliseconds since January 1, 1970, 00:00:00 GMT.
 void setToNanos(long nanos)
          Sets the fields of this Timespec object to the specified time value, expressed in nanoseconds since January 1, 1970, 00:00:00 GMT.
 void setToTimespec(Timespec tv)
          Sets the fields of this Timespec object to the specified time value, expressed as another Timespec object.
 Date toDate()
           
 long toMillis()
           
 void zero()
          Zeroes all fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sec

public int sec
Seconds. Darwin type: __darwin_time_t (4 bytes (32-bit platforms), 8 bytes (64-bit platforms))


nsec

public int nsec
Nanoseconds. Darwin type: long (4 bytes (32-bit platforms), 8 bytes (64-bit platforms))

Constructor Detail

Timespec

public Timespec()
Method Detail

setToNanos

public void setToNanos(long nanos)
Sets the fields of this Timespec object to the specified time value, expressed in nanoseconds since January 1, 1970, 00:00:00 GMT.

Parameters:
nanos - the new time value, in nanoseconds since January 1, 1970, 00:00:00 GMT.

setToMillis

public void setToMillis(long millis)
Sets the fields of this Timespec object to the specified time value, expressed in milliseconds since January 1, 1970, 00:00:00 GMT.

Parameters:
millis - the new time value, in milliseconds since January 1, 1970, 00:00:00 GMT.

setToDate

public void setToDate(Date d)
Sets the fields of this Timespec object to the specified time value, expressed as a Java date.

Parameters:
d - the new time value.

setToTimespec

public void setToTimespec(Timespec tv)
Sets the fields of this Timespec object to the specified time value, expressed as another Timespec object.

Parameters:
tv - the new time value.

zero

public void zero()
Zeroes all fields.


toMillis

public long toMillis()

toDate

public Date toDate()

printFields

public void printFields(String prefix,
                        PrintStream ps)

print

public void print(String prefix,
                  PrintStream ps)