org.ros.message
Class Time
java.lang.Object
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"
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
secs
public int secs
nsecs
public int nsecs
Time
public Time()
Time
public Time(int secs,
int nsecs)
Time
public Time(double secs)
Time
public Time(Time t)
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>