org.ros.message
Class Time

java.lang.Object
  extended by org.ros.message.Time
All Implemented Interfaces:
java.lang.Comparable<Time>

public class Time
extends java.lang.Object
implements java.lang.Comparable<Time>

ROS Time representation. Time and Time are primitive types in ROS. ROS represents each as two 32-bit integers: seconds and nanoseconds since epoch.

See Also:
"http://www.ros.org/wiki/msg"

Field Summary
 int nsecs
           
 int secs
           
 
Constructor Summary
Time()
           
Time(double secs)
           
Time(int secs, int nsecs)
           
Time(Time t)
           
 
Method Summary
 Time add(Duration d)
           
 int compareTo(Time t)
           
 boolean equals(java.lang.Object obj)
          Check for equality between Time objects.
static Time fromMillis(long timeInMillis)
           
static Time fromNano(long timeInNs)
           
 int hashCode()
           
 boolean isZero()
           
 void normalize()
           
 Time subtract(Duration d)
           
 Duration subtract(Time t)
           
 double toSeconds()
           
 java.lang.String toString()
           
 long totalNsecs()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

secs

public int secs

nsecs

public int nsecs
Constructor Detail

Time

public Time()

Time

public Time(int secs,
            int nsecs)

Time

public Time(double secs)

Time

public Time(Time t)
Method Detail

add

public Time add(Duration d)

subtract

public Time subtract(Duration d)

subtract

public Duration subtract(Time t)

fromMillis

public static Time fromMillis(long timeInMillis)

fromNano

public static Time fromNano(long timeInNs)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toSeconds

public double toSeconds()

totalNsecs

public long totalNsecs()

isZero

public boolean isZero()

normalize

public void normalize()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Check for equality between Time objects.

This method does not normalize Time representations, so fields must match exactly.

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(Time t)
Specified by:
compareTo in interface java.lang.Comparable<Time>